Oh well... My point was that the carry bit has nothing to do with the *acualy used* instruction in the code, rlncf. In the lines after (that you snipped) I *did* say that you instead has to deal with the MSB of the rotated byte. (Which probably will be much less "unknown" then the C bit.) I also showed the possibility of adding W with itself on the 18-series, so you don't need the separate temp variable (as in Alan's method). (I hope it works ! :-) ) Never mind... Jan-Erik. -----Original Message----- From: Olin Lathrop [mailto:olin_piclist@EMBEDINC.COM] Sent: den 16 oktober 2003 13:51 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC:] RETLW on 18F >> First doing a rotate can be a bad way to do it, because you first need >> to clear the carry bit. > > Note the use of RLNCF "rotate left no carry". That only means that the LSB comes from the MSB instead of the C flag. You still have to deal with the unknown bit value. Alan's method essentially does a left shift of 1 and guarantees that the LSB will be zero in one instruction. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.