Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 9: Instruction Set
Syntax: [label] XORWF f, d
Description: The content of register f is XOR’ed with the content of register W. A bit of
result is set only if the corresponding bits of operands are different. If d = w or d = 0, the
result is stored in register W. If d = f or d = 1, the result is stored in register f.
Operation: (W) .XOR. k -> d
Operand: 0 f 127, d[0,1]
Status affected: Z
Number of cycles: 1
EXAMPLE 1:
....
[label] XORWF REG,f
Before instruction execution: REG = 0xAF, W = 0xB5 ; 1010 1111
(0xAF)
; 1011 0101 (0xB5)
------------------
After instruction: REG = 0x1A, W = 0xB5 ; 0001 1010 (0x1A)
EXAMPLE 2:
....
[label] XORWF REG,w
Before instruction execution: REG = 0xAF, W = 0xB5 ; 1010 1111
(0xAF)
; 1011 0101 (0xB5)
------------------
After instruction: REG = 0xAF, W = 0x1A ; 0001 1010 (0x1A)
In addition to the preceding instructions, Microchip has also introduced some other
instructions. To be more precise, they are not instructions as such, but macros supported by
MPLAB. Microchip calls them "Special Instructions" since all of them are in fact obtained by
http://www.mikroe.com/en/books/picmcubook/ch9/ (33 of 35)5/3/2009 11:35:12 AM