PIC16C925/926
ANDLW
AND Literal with W
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
[ label ] ANDLW k
0 ≤ k ≤ 255
(W) .AND. (k) → (W)
Z
11 1001 kkkk kkkk
The contents of W register are
AND’ed with the eight-bit literal 'k'.
The result is placed in the W
register.
Words:
Cycles:
Q Cycle Activity:
1
1
Q1
Q2
Q3
Q4
Decode
Read Process
literal ‘k’ data
Write to
W
Example
ANDLW
Before Instruction:
W = 0xA3
After Instruction:
W = 0x03
0x5F
ANDWF
AND W with f
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
[ label ] ANDWF f [,d]
0 ≤ f ≤ 127
d ∈ [0,1]
(W).AND. (f) → (destination)
Z
00 0101 dfff ffff
AND the W register with 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
Q1 Q2 Q3
Q4
Decode
Read
register
'f'
Process Write to
data destination
Example
ANDWF
FSR, 1
Before Instruction:
W
=
FSR =
After Instruction
W
=
FSR =
0x17
0xC2
0x17
0x02
DS39544A-page 116
Preliminary
2001 Microchip Technology Inc.