James, Why not check the register for zero. If it is zero, both nibbles are zero. If non zero, check for greater than 15. If it is, subtract 15, and what remains is the upper nibble. Is this correct? Regards, Jim On Tue, 23 January 2001, 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 > #include <16c55.inc> ; processor assembler definitions > _CONFIG _xt_osc & _wdt_off & _protect_off > reset start > > org 8 > BufTyp Res d'1' ; Pin number to set (0-7). > > org 0 > start > CALL noznibs > ; .... > HALT > > noznibs > MOVF BufTyp,w > ANDLW 0x0F > BTFSC status,z > RET > SUBWF Buftyp,w > BTFSC status,z > RET > > --- > James Newton (PICList Admin #3) > mailto:jamesnewton@piclist.com 1-619-652-0593 > PIC/PICList FAQ: http://www.piclist.com or .org > > -- > 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 jim@jpes.com -- 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