This code is fine. You're putting 0x00 in the w register, then copying it to TRISA, TRISB, and TRISC. As long as you don't execute any instruction that modifies w between these instructions, you're fine. (The value of w won't change on its own.) Be especially careful if you put a call statement in a sequence like this, as the subroutine is likely to modify w. The code snippet you posted is sound and correct and quite usable. An alternate way to accomplish the same thing would be: clrf TRISA clrf TRISB clrf TRISC This not only saves you an instruction (which sometimes is important and sometimes isn't), it also means you don't have to rely on the contents of the w register. Preserving the value of w in an instruction sequence like this is often useful, depending on what you have before and after the sequence. (In this particular case, clearing the TRIS registers, you're not likely to have code before and after that needs to preserve w. But you might have simiar code in other functional blocks where using clrf rather than movlw 0x00 followed by movwf would come in handy.) -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of solarwind Sent: Wednesday, December 17, 2008 4:48 PM To: Microcontroller discussion list - Public. Subject: [PIC] movlw Moves or Copies? If I do something like: movlw 0x00 movwf TRISA movwf TRISB movwf TRISC is it correct? Or do I need to movlw before every movwf? -- ..::[ solarwind ]::.. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist