Advance Information
UM-TM57PE10_E
8-Bit Microcontroller
35
tenx technology inc.
Preliminary
Rev 1.4, 2012/01/19
ADDLW
Add Literal "k" and W
Syntax
ADDLW k
Operands
k : 00h ~ FFh
Operation
(W) ← (W) + k
Status Affected
C, DC, Z
OP-Code
01 1100 kkkk kkkk
Description
The contents of the W register are added to the eight-bit literal 'k' and the
result is placed in the W register.
Cycle
1
Example
ADDLW 0x15
B : W = 0x10
A : W = 0x25
ADDWF
Add W and "f"
Syntax
ADDWF f [,d]
Operands
f : 00h ~ 7Fh, d : 0, 1
Operation
(d
estination) ← (W) + (f)
Status Affected
C, DC, Z
OP-Code
00 0111 dfff ffff
Description
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'.
Cycle
1
Example
ADDWF FSR, 0
B : W = 0x17, FSR = 0xC2
A : W = 0xD9, FSR = 0xC2
ANDLW
Logical AND Literal "k" with W
Syntax
ANDLW k
Operands
k : 00h ~ FFh
Operation
(W) ← (W) AND k
Status Affected
Z
OP-Code
01 1011 kkkk kkkk
Description
The contents of W register are AND’ed with the eight-bit literal 'k'. The
result is placed in the W register.
Cycle
1
Example
ANDLW 0x5F
B : W = 0xA3
A : W = 0x03
ANDWF
AND W with "f"
Syntax
ANDWF f [,d]
Operands
f : 00h ~ 7Fh, d : 0, 1
Operation
(destina
tion) ← (W) AND (f)
Status Affected
Z
OP-Code
00 0101 dfff ffff
Description
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'.
Cycle
1
Example
ANDWF FSR, 1
B : W = 0x17, FSR = 0xC2
A : W = 0x17, FSR = 0x02