On Mon, 10 May 1999, Regulus Berdin wrote: > > Hi, > > I will do it this way (untested): > > clear_bit: > movlw 0b10000000 > movwf mask > > movf test,w > addwf PCL,f ;carry is always clear > rrf mask,f > rrf mask,f > rrf mask,f > rrf mask,f > rrf mask,f > rrf mask,f > rrf mask,f > > comf mask,w ;invert mask > andwf PORTB,f ;clear bit > > 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 I like it. How 'bout: rlf test,W andlw 0x0e addwf pcl,f bcf PORTB,0 return bcf PORTB,1 return . . . bcf PORTB,7 return ? 7-iso cycles.