Right, I would write this code by the same way knowing no one other will have to do some corrections in such program. Even I have problems with such not enough commented pieces of my program written years ago. Igor -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Scott Dattalo Sent: Sunday, February 23, 2003 7:42 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Setting Bits Dynamically On Sun, 23 Feb 2003, Olin Lathrop wrote: > > I think this is totally obvious: > > > > movff PORT, FSR0L > > movlw 0x04 > > btfss PIN,1 > > movlw 0x01 > > btfsc PIN,0 > > rlncf WREG,F > > btfsc PIN,2 > > swapf WREG,F > > iorwf INDF0,F > > I think that's a bit rough, Scott. The guy said he was a newbie. This > kind of obscure and undocumented code is not a good example, even if it > does work (I haven't taken the time to follow it thru in detail either). Me rough? Isn't this something like the Black calling the Kettle Pot? You have to read my e-mail as a continuation of the original poster's message. Then read the code. Then you'll have no choice but to conclude that, hey, It's Obvious! Not to mention, it's twice as fast as all other solutions proposed. You really ought to take the time to read it, you might learn something... -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. --- avast! Antivirus: Inbound message clean. Virus Database (VPS): 21.2.2003 Tested on: 23.2.2003 19:43:24 avast! is copyright (c) 2000-2003 ALWIL Software. http://www.avast.com --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 21.2.2003 Tested on: 23.2.2003 20:35:14 avast! is copyright (c) 2000-2003 ALWIL Software. http://www.avast.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.