鈭?/div>
[0,1]
(f) - (W)
鈫?(dest)
C, DC, Z
00
0010
dfff
ffff
SUBWF f,d
The W register is subtracted (2鈥檚 com-
plement method) from the eight bit literal
'k'. The result is placed in the W register.
Words:
Cycles:
Example 1:
1
1
SUBLW
0x02
W
C
=
=
1
?
Subtract (2鈥檚 complement method) W reg-
ister from register 'f'. If 'd' is 0 the result is
stored in the W register. If 'd' is 1 the
result is stored back in register 'f'.
Words:
Cycles:
Example 1:
1
1
SUBWF
REG1
W
C
Before Instruction
REG1,1
=
=
=
3
2
?
Before Instruction
After Instruction
W
C
=
=
1
1; result is positive
Example 2:
Before Instruction
W
C
=
=
2
?
After Instruction
REG1
W
C
=
=
=
1
2
1; result is positive
After Instruction
W
C
=
=
0
1; result is zero
Example 2:
Before Instruction
REG1
W
C
=
=
=
2
2
?
Example 3:
Before Instruction
W
C
=
=
3
?
After Instruction
REG1
W
C
=
=
=
0
2
1; result is zero
After Instruction
W =
C
=
tive
0xFF
0; result is nega-
Example 3:
Before Instruction
REG1
W
C
=
=
=
1
2
?
After Instruction
REG1
W
C
=
=
=
0xFF
2
0; result is negative
DS30559A-page 84
漏
1996 Microchip Technology Inc.