John Payson wrote: > > If it's okay (or desirable) to have the result in W as well as F, it can be > done safely in 4 cycles: > > movlw 1 > btfss scanbit,7 > rlf scanbit,w > movwf scanbit Another variant. movfw scanbit addwf scanbit,f skpnz bsf scanbit,0 After this W contain previous scan and scanbit contain next scan. WBR Dmitry.