Subtract Literal with W
The W register is subtracted (2’s complement method) from the eight-bit literal ‘k’. The result is placed in the W register.
[the_ad id=”3059″]Syntax:
[ label ] SUBLW k
Operation:
k – (W) → (W)
Operands:
- k is from 0 to 255
Status Affected: None
Example:
1 |
SUBLW 0x01 |
1 |
W = 0x2C |
1 |
W = 0x2B |
Example:
1 |
SUBLW b'01011101' |
1 |
W = b'11010110' |
1 |
W = b'01111010' ;two's complement |