Guys - the EASY way to clear carry is use the pseudo-op 'clrc' (this is translated by MPASM into 'bcf status,0'); the EASY way to set carry is to use the matching pseudo-op 'setc' (translated by MPASM into 'bsf status,0'). There is a handful of pseudo-ops in the MPASM documentation that make doing simple things easier to do and understand. As far as the original question goes, both RLF and RRF rotate through the carry bit. If you want to do a standard rotate without having the carry bit affect the result, you first have to preset the carry bit to the proper value. This may not be obvious - you can't just set or clear carry - it has to be set to the 'proper' value! If you can afford to trash W, this is very easy: rlf reg,W ;rotate reg into W (discard) BUT also preset C rlf reg,F ;rotate reg for real - C contains proper value If you can't afford to trash W, it is slightly more difficult: clrc ;ensure C matches bit about to be shifted into it btfsc reg,7 ;use bit 0 if rotating right setc ; rlf reg,F hope this helps. dwayne >Michael J. Ghormley wrote: > > >>I would have used: >> CLRW ; W = b'00000000', CARRY = ? >> ADDWF W,W ; W = b'00000000', CARRY = 0 >>and then done the rotate. >> >>Am I wrong? Did I miss something? > > >I do the same thing to clear the Carry, and I generally use: > > CLRW > SUBWF Anyfile,F > >to set it. This works since the Carry is always set (as a borrow) before a >subtraction. Don't remember right now why I do it this way. I think the >data sheets were a little unclear when I first read them, so I started this >way, and never looked back. Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (403) 489-3199 voice (403) 487-6397 fax