English
Language : 

PIC16F8X_13 Datasheet, PDF (57/128 Pages) Microchip Technology – 18-pin Flash/EEPROM 8-Bit Microcontrollers
9.1 Instruction Descriptions
ADDLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Add Literal and W
[label] ADDLW k
0  k  255
(W) + k  (W)
C, DC, Z
11 111x kkkk kkkk
The contents of the W register are
added to the eight bit literal 'k' and the
result is placed in the W register.
1
1
Q1
Q2
Q3
Q4
Decode Read Process Write to
literal 'k' data
W
Example:
ADDLW 0x15
Before Instruction
W = 0x10
After Instruction
W = 0x25
PIC16F8X
ANDLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
AND Literal with W
[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.
1
1
Q1
Q2
Q3
Q4
Decode Read Process Write to
literal "k" data
W
Example
ANDLW 0x5F
Before Instruction
W = 0xA3
After Instruction
W = 0x03
ADDWF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Add W and f
[label] ADDWF f,d
0  f  127
d 
(W) + (f)  (destination)
C, DC, Z
00 0111 dfff ffff
Add the contents of 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
ADDWF FSR, 0
Before Instruction
W = 0x17
FSR = 0xC2
After Instruction
W = 0xD9
FSR = 0xC2
ANDWF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
AND W with f
[label] ANDWF f,d
0  f  127
d 
(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 regis-
ter. 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 = 0x17
FSR = 0xC2
After Instruction
W = 0x17
FSR = 0x02
 1996-2013 Microchip Technology Inc.
DS30430D-page 57