PIC Language Doubt

XORWF PORTA,1 could someone please tell me why we have a 1 after porta.the comtents of W ref are exored with porta.to toggle bit 2 of porta w reg should be loaded with 00100.now bit 2 of port a is toggled.then why do we need the extra 1 at end of the instruction

Reply to
dilip.devaraj
Loading thread data ...

It's just karma !!

--
Cheers ............. Rheilly P
Reply to
Rheilly Phoull

XORWF f,d

f = "register file address" d = "destination" (of results) if 0 then the results are stored in the W register (accumulator) if 1 then the results are stored in the "file register" (PORTA in this case).

It's more readable to use "W" or "F" rather than "0" or "1".

This is a read-modify-write instruction. The sampled state of PORTA is XOR'd with the W register (whatever the voltage levels on the pins translates to), and then the result is stored back on PORTA.

See the reference manuals for the relevant family.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.