Instruction Set ArchitectureIP2022 Users Manual
126
www.ubicom.com
CMP W,#lit8
Compare W,Literal
Operation:
lit8 - W; result is discarded, STATUS is updated
Bits affected:
C, DC, Z
Opcode:
0111 1001 kkkk kkkk
Description:
This instruction subtracts the contents of W from
an 8-bit literal and discards the result. W is left
unchanged. Only the STATUS register bits are
updated.
If the result of subtraction is negative (W is larger
than lit8), the C bit is cleared and the lower eight
bits of the result are written to W. 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 Z bit is cleared.
Cycles:
1