
PIC18F6X2X/8X2X
DS39612A-page 284
Advance Information
2003 Microchip Technology Inc.
ADDWFC
Example:
Before Instruction
Carry bit =
REG
W
After Instruction
Carry bit =
REG
W
ANDLW
Example:
Before Instruction
W
After Instruction
W
ADD W and Carry bit to f
Syntax:
Operands:
[
label
] ADDWFC f [,d [,a]
0
≤
f
≤
255
d
∈
[0,1]
a
∈
[0,1]
(W) + (f) + (C)
→
dest
N,OV, C, DC, Z
Operation:
Status Affected:
Encoding:
Description:
0010
00da
ffff
ffff
Add W, the Carry Flag and data
memory location ‘f’. If ‘d’ is 0, the
result is placed in W. If ‘d’ is 1, the
result is placed in data memory loca-
tion ‘f’. If ‘a(chǎn)’ is 0, the Access Bank
will be selected. If ‘a(chǎn)’ is 1, the BSR
will not be overridden.
1
1
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Read
register ‘f’
Q3
Q4
Decode
Process
Data
Write to
destination
ADDWFC
REG, 0, 1
1
0x02
0x4D
=
=
0
0x02
0x50
=
=
AND literal with W
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
[
label
] ANDLW k
0
≤
k
≤
255
(W) .AND. k
→
W
N,Z
0000
1011
kkkk
kkkk
The contents of W are ANDed with
the 8-bit literal ‘k’. The result is
placed in W.
1
1
Words:
Cycles:
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read literal
‘k’
Process
Data
Write to W
ANDLW
0x5F
=
0xA3
=
0x03