Hi, you can XOR movlw b'00011110' xorwf counter,w skpnz goto do_something or movlw .30 xorwf counter,w bz do_something or movf counter,w xorlw .30 bz do_something Only when all bits of the test and target are the same positions and polarity will the result be zero. This includes the bits you aren't interested in 00011110 00011110 XOR ---------- 00000000 It's a very useful function, and is reversible, for example in a character search xorlw "A" ;test W for "A" bz is_a ;yes, branch xorlw "A" ;no, restore W 01000010 'B', W contents 01000001 XOR with 'A' ---------- 00000011 result, W not zero 01000001 XOR with 'A' ---------- 01000010 result, 'B' restored to W Can also be compounded xorlw "1" ;test W for '1' bz job1 ;yes, branch xorlw "1" ^ "2" ;no, restore W, test for '2' bz job2 ;yes, branch Joe --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .