Hi Reggie. This way was definitely tested and discussed sometime ago ;-) > Or: > clear_bit: > movlw 1 ;mask=2^test > btfsc test,1 > movlw 4 > movwf mask > > btfsc test,0 > addwf mask,f > > btfsc test,2 > swapf mask,f > > comf mask,w ;invert mask > andwf PORTB,f > > regards, > Reggie