>My point was that the carry bit has nothing to do >with the *acualy used* instruction in the code, rlncf. Yes, and I did not reply to that point, which I do take note of. >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.) And yes I noticed that too, although I took it as meaning that if the MSB is set, then you lose it into the carry, and in your code that case is not taken care of (i.e. W > 127) >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 ! :-) ) Not sure, not having used the 18 series yet, so have not looked closely at the instruction set. However as W is also available as WREG, is it possible to add WREG to W thereby avoiding the temp var? -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.