PIC16C926-I/CL Microchip Technology, PIC16C926-I/CL Datasheet - Page 131

no-image

PIC16C926-I/CL

Manufacturer Part Number
PIC16C926-I/CL
Description
64/68-Pin CMOS Microcontrollers with LCD Driver
Manufacturer
Microchip Technology
Datasheet
SUBLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example 1:
Example 2:
Example 3:
2001 Microchip Technology Inc.
Before Instruction:
After Instruction:
Before Instruction:
After Instruction:
Before Instruction:
After Instruction:
W
C
Z
W
C
Z
W
C
Z
W
C
Z
W
C
Z
W
C
Z
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
1
?
?
1
1; result is positive
0
2
?
?
0
1; result is zero
1
3
?
?
0xFF
0; result is negative
0
Subtract W from Literal
[ label ] SUBLW k
0
k - (W)
C, DC, Z
The W register is subtracted (2’s
complement method) from the eight-
bit literal 'k'. The result is placed in the
W register.
1
1
SUBLW
Decode
Q1
11
k
255
0x02
literal ’k’
W)
110x
Read
Q2
Process
kkkk
data
Q3
Write to W
kkkk
Q4
Preliminary
SUBWF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example 1:
Example 2:
Example 3:
Before Instruction:
After Instruction:
Before Instruction:
After Instruction:
Before Instruction:
After Instruction:
REG1
W
C
Z
REG1
W
C
Z
REG1
W
C
Z
REG1
W
C
Z
REG1
W
C
Z
REG1
W
C
Z
PIC16C925/926
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
Subtract W from f
[ label ] SUBWF f [,d]
0
d
(f) - (W)
C, DC, Z
Subtract (2’s complement method) W
register 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'.
1
1
SUBWF
Decode
Q1
00
f
[0,1]
3
2
?
?
1
2
1; result is positive
0
2
2
?
?
0
2
1; result is zero
1
1
2
?
?
0xFF
2
0; result is negative
0
127
REG1,1
register ’f’
destination)
0010
Read
Q2
DS39544A-page 129
Process
dfff
data
Q3
destination
Write to
ffff
Q4

Related parts for PIC16C926-I/CL