>Next problem though has got me. > > decfsz count_ts ; decrease counter if not zero >; > addlw .0 ; put 0 in w reg This does NOT put 0 in w reg, use movlw .0 to do that > xorlw count_ts ; is counter at 0 > btfsc status,Z > bcf flag,0 ; yes so set flag,0 to 0 >; > >As you van see, I'm decreasing a counter on a program loop. When the >counter reaches 0, I want to set the flag,0 bit to 0. Thing is the xorlw >or the btfsc is not picking up the 0 in count_ts. > if the flag is not used in an interrupt routine you could do the following bcf flag,0 decfsz count_ts,f bsf flag,1 ; set bit if counter not zero michael