Used Bob's example from tech ref.... (must learn how to google properly before asking stupid q's Steve -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Jinx Sent: 10 August 2006 11:01 To: Microcontroller discussion list - Public. Subject: Re: [PIC] bit set/ clear (n) How'd ya do it Steve ? Bob Ammerman gave this solution for 18F (where WREG is directly accessible). I use it often, with the routine name "bobbit" (not to be confused with John Wayne ....) example movlw b'00000110' ;temp0 = 6 movwf temp0 bobbit movlw .1 btfsc temp0,1 movlw .4 btfsc temp0,0 addwf wreg,w btfsc temp0,2 swapf wreg,w movwf temp1 temp1 = b'01000000'. Gives you bit position 6 set for masking or for 16F http://www.piclist.com/techref/microchip/math/bit/setbit.htm -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist