IP2022 Users ManualInstruction Set Architecture
www.ubicom.com
219
SUBC fr,W
Subtract Carry,W from fr into fr
Operation:
fr = fr - C - W
Bits affected:
C, DC, Z
Opcode:
0100 101f ffff ffff
Description:
This instruction subtracts the contents of W and
the complement of the C bit (which indicates
borrow) from the contents of the specified data
memory location and writes the 8-bit result into
the same data memory location. W is left
unchanged. The register contents are treated as
unsigned values.
If the result of subtraction is negative (W + C is
larger than fr), the C bit is cleared and the lower
eight bits of the result are written to the data
memory location. Otherwise, the C bit is set.
If there is a borrow from bit 3 to bit 4, the DC (digit
carry) bit is cleared. Otherwise, the bit is set.
If the result of subtraction is zero, the Z bit is set.
Otherwise, the bit is cleared.
Cycles:
1