Michael S. Hagberg wrote: > thanks scott, i made the change and am reposting, your message, i did a > reply and forgot to see who it was being sent to, you must have your reply > to set in the mail, i leave mine blank. > > here is an idea (not tested) 12 bytes of code no looping, and leaves x > alone. > > michael > > swapf x,w > xorwf x,w ; xor nibbles, now we have only 4 bits to test > andlw 0F0h ; clear lower nibble for counter > movwf parity > btfsc parity,4 ; test bits now > incf parity,f > btfsc parity,5 > incf parity,f > btfsc parity,6 > incf parity,f > btfsc parity,7 > incf parity,f > > btfsc parity,0 ; use this to test for parity rrf x,w ;x.A.B.C.D.E.F.G xorwf x,w ;x^A.A^B.B^C.C^D.D^E.E^F.F^G.G^H movwf parity rrf parity,w rlf parity,f xorwf parity,f swapf parity,w xorwf parity,f btfsc parity,5 ;... WBR Dmitry.