PIC16F818/819
SUBLW
Subtract W from Literal
XORLW
Exclusive OR Literal with W
Syntax:
[ label ]
SUBLW k
Syntax:
[ label ] XORLW k
Operands:
Operation:
0 ≤ k ≤ 255
Operands:
0 ≤ k ≤ 255
k – (W) → (W)
Operation:
(W) .XOR. k → (W)
Status Affected: C, DC, Z
Status Affected:
Description:
Z
Description:
The W register is subtracted (2’s
The contents of the W register
are XORed with the eight-bit
literal ‘k’. The result is placed in
the W register.
complement method) from the
eight-bit literal ‘k’. The result is
placed in the W register.
XORWF
Syntax:
Exclusive OR W with f
SUBWF
Subtract W from f
Syntax:
[ label ]
SUBWF f,d
[ label ] XORWF f,d
Operands:
0 ≤ f ≤ 127
d ∈ [0,1]
Operands:
0 ≤ f ≤ 127
d ∈ [0,1]
Operation:
(f) – (W) → (destination)
Operation:
(W) .XOR. (f) → (destination)
Status Affected: C, DC, Z
Status Affected:
Description:
Z
Description:
Subtract (2’s complement method)
Exclusive OR the contents of the
W register with register ‘f’. If
‘d’ = 0, the result is stored in the
W register. If ‘d’ = 1, the result is
stored back in register ‘f’.
W register from register ‘f’. If
‘d’ = 0, the result is stored in the W
register. If ‘d’ = 1, the result is
stored back in register ‘f’.
SWAPF
Syntax:
Swap Nibbles in f
[ label ] SWAPF f,d
Operands:
0 ≤ f ≤ 127
d ∈ [0,1]
Operation:
(f<3:0>) → (destination<7:4>),
(f<7:4>) → (destination<3:0>)
Status Affected: None
Description:
The upper and lower nibbles of
register ‘f’ are exchanged. If
‘d’ = 0, the result is placed in W
register. If ‘d’ = 1, the result is
placed in register ‘f’.
DS39598E-page 110
2004 Microchip Technology Inc.