----- Original Message ----- From: "Jan-Erik Soderholm XA (TN/PAC)" To: Sent: Monday, October 06, 2003 11:07 AM Subject: Re: [PIC]: Rotating a bit over 2 bytes > jumanji wrote: > > I'm trying to rotate 1 bit through 2 bytes. > Rotate *one* bit ? > What about the other 15 bits ? > Shouldn't they also "rotate" ? Errhmm.... yes :-) Actually I meant something like: "one 'set' bit that rotates over 2 bytes" > To rotate *all* bits in two bytes left : > (bit 7 of byte 2 goes into bit 0 of byte 1 and > bit 7 of byte 1 goes int0 byte 0 of byte 2) > bsf status, c ;Setup carry flag... > btfss byte2,7 ;...according to bit 7 > bcf status, c ;...of byte 2 > rlcf byte 1 ;rotate carry into byte 1 > rlcf byte 2 ;same for byte 2 > > Jan-Erik. This is truly amazing, I'd never have thought of something like this, thanks alot !!! -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.