rlf GPIO,w ; W = 0DC0BAxc x = old GP0, movwf SWITCH ; SWITCH = 0DC0BAxc c = old carry rlf SWITCH,f ; SWITCH = DC0BAxc0 movlw 0x18 ; W = 00011000 andwf SWITCH,w ; W = 000BA000 addwf SWITCH,f ; SWITCH = DCBA0xc0 Obviously, two more instructions can "clean" the spurious bits out. -- Cheers, Paul B.