> xorlw (0x05 ^ 0x20) ; CV545 Harry, as Maarten said, the 5 restores W, and 20 is the next test. Here's one I use for checking a character in a serial string. The commented XORLW values are what are executed (ie what's in Program Memory). movfw indf0 chk_n xorlw "N" ;XORLW 0x4e bnz chk_f ;if not "N" bsf off_on ;else set to "device on" bra ss chk_f xorlw "N"^"F" ;XORLW 0x08 bnz chk_st ;if not "F" bra ss ;else leave as "device off" chk_st xorlw "F"^"S" ;XORLW 0x15 bz st_req ;status request bra ss If you follow the bit patterns in binary you'll see how it works, for example W ^ 0x4e W ^ 0x4e then W ^ 0x46 4e 01001110 ^ 46 01000110 -------------- 08 00001000 Here's another one goes_hi movfw dev_no ;set test bit, goes high xorlw .1 bnz h2 movlw .1 iorwf instath bra in_rdy h2 xorlw .1^.2 ;restore, test new value bnz h3 movlw .2 iorwf instath bra in_rdy h3 xorlw .2^.3 bnz h4 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist