Michael J. Ghormley wrote: > ; SHIFT BITS TO ALIGN WITH THE HIGH NYBBLE > BTFSC W,5 ; is GP5 (pin 2) HI? > BSF W,7 ; if it is, then Bit7=HI > BTFSC W,4 ; is GP4 (pin 3) HI? > BSF W,6 ; if it is, then Bit6=HI > ANDLW 0x0C6 ; W = DC000BA0 > BTFSC W,2 ; is GP2 (pin 5) HI? > BSF W,5 ; if it is, then Bit5=HI > BTFSC W,1 ; is GP1 (pin 6) HI? > BSF W,4 ; if it is, then Bit4=HI > ; W = DCBA0BA0 > ; > ; MASK OFF LOW NYBBLE > ANDLW 0x0F0 ; W = DCBA0000 > It looks right to me but I am getting flakey results and I am > suspicious of the bit manipulation. It is late Sunday night in > California and of course I have a demo in twelve hours... The "flakiest" thing here I can see is that you can't do bit manipulation on the W register. "W" as a symbol translates to zero, and is a synonym for the INDF register. Which register you are actually manipulating therefore depends on the present setting of the FSR, which is?... -- Cheers, Paul B.