SUBLW

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:

SUBLW 0x01

Before instruction:

W = 0x2C

After instruction:

W = 0x2B

[the_ad id="3059"]

Example:

SUBLW b'01011101'

Before instruction:

W = b'11010110'

After instruction:

W = b'01111010' ;two's complement