It does have to work on a 16c55 (actually an SX 28) but can't I just: MOVLW 0xEF ADDF BufTyp, W SKPNC SKPDC RETLW 0 ??? Seems like that would work and its darn tricky... Nice idea! Thanks. --- James Newton (PICList Admin #3) mailto:jamesnewton@piclist.com 1-619-652-0593 PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Andrew Warren Sent: Tuesday, January 23, 2001 14:22 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC:] code challenge - test both nibbles non-zero j newton wrote: > Ok, I'm storing two 4 bit wide variables in one byte (file register) > and I need to test that neither variable is zero. i.e. the byte is not > 0X or X0 hex were X is any 4 bit value. The best I can do is 7, any > better? > > P = pic16c55 > .... > MOVF BufTyp,w > ANDLW 0x0F > BTFSC status,z > RET > SUBWF Buftyp,w > BTFSC status,z > RET James: Does it HAVE to work on a 16C55? If you had an ADDLW instruction, you could do this: MOVF BufTyp,W ADDLW 0xEF SKPNC SKPDC RETLW 0 -Andy === Andrew Warren --- aiw@cypress.com === Staff Systems Engineer, IPD === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.