Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 9: Instruction Set
If d = w or d = 0 the result is stored in the W register.
If d = f or d = 1 the result is stored in register f.
Operation: (W) + (f) -> d
Operand: 0 f 127, d [0,1]
Status affected: C, DC, Z
Number of cycles: 1
EXAMPLE 1:
....
[label] ADDWF REG,w
Before instruction execution: W = 0x17
REG = 0xC2
After instruction: W = 0xD9
REG = 0xC2
C=0 (No carry occurs, i.e. the result is maximum 8-bit long).
EXAMPLE 2:
....
[label] ADDWF INDF,f
Before instruction execution: W=0x17
FSR = 0xC2 Register at address 0xC2 contains the value 0x20
After instruction: W = 0x17
FSR=0xC2, Register at address 0xC2 contains the value 0x37
ANDLW - AND literal with W
Syntax: [label] ANDLW k
Description: The content of the register W is AND’ed with the 8-bit literal k. It means that
the result will contain one (1) only if both corresponding bits of operand are ones (1). The
result is stored in the W register.
http://www.mikroe.com/en/books/picmcubook/ch9/ (6 of 35)5/3/2009 11:35:12 AM