On Fri, 21 Nov 2003 16:21:39 +0100, Marcel van Lieshout wrote: >This is how I do it: > >The C-code: > portD ^= 0x03; > >The generated assembler: > movlw 3 > xorwf H'F83' > >So, I was already using his samplecode. PortD is never read. > I've lost track of the processor type in question but your statement isn't true with respect to the 16 series PICs. (That "F83" address indicates that you're not talking about the 16 series. Is that an address for the 18 series?) For 16 series parts: While the port may never be getting explicitly read with a MOVF instruction, it certainly gets read when the XORWF is executed. The port is read, its contents are XOR'd with the constant in W and the resulting value is written back to the port. Regards, Bob -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body