Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 9: Instruction Set
EXAMPLE :
....
[label] SUBLW 0x03
Before instruction execution: W = 0x01, C = x, Z = x
After instruction: W = 0x02, C = 1, Z = 0 result is positive
Before instruction execution: W = 0x03, C = x, Z = x
After instruction: W = 0x00, C = 1, Z = 1 result is 0
Before instruction execution: W = 0x04, C = x, Z = x
After instruction: W = 0xFF, C = 0, Z = 0 result is negative
SUBWF - Subtract W from f
Syntax: [label] SUBWF f, d
Description: The content of register W is subtracted from register f.
If d = w or d = 0, the result is stored in register W. If d = f or d = 1, the result is stored in
register f.
Operation: (f) - (W) -> d
Operand: 0 f 127, d [0,1]
Status affected: C, DC, Z
Number of cycles: 1
EXAMPLE :
....
[label] SUBWF REG,f
Before instruction execution: REG = 3, W = 2, C = x, Z = x
After instruction: REG = 1, W = 2, C = 1, Z = 0 result is
positive
Before instruction execution: REG = 2, W = 2, C = x, Z = x
http://www.mikroe.com/en/books/picmcubook/ch9/ (30 of 35)5/3/2009 11:35:12 AM