CMPI

From Intellivision Wiki
Jump to: navigation, search
Instruction NameComnpare Immediate
MnemonicCMPI
CP1610 Clock Cycles8 or 10
InterruptibleYes
Opcode Range$0378-$037F
Input FlagsNone
Output FlagsSign Flag, Zero Flag, Overflow Flag, Carry Flag

The Compare Immediate (CMPI) instruction is functionally identical to the Subtract Immediate instruction except that it does not store the resulting value in the destination register. The Compare Immediate instruction subtracts the value at the address immediately following the opcode from the value in the specified destination register, and sets or clears the Sign Flag, Zero Flag, Overflow Flag, and Carry Flag according to the result, but the final result is not stored in the destination register, leaving the register unchanged. Note that this is instruction is really just a variant of the Compare Indirect instruction using R7 as the address register. See the Compare Indirect documentation for more information.

   0000:0011:0111:1ddd
where: ddd indicates the destination register such that: ddd == 000 indicates register R0 ddd == 001 indicates register R1 ddd == 010 indicates register R2 ddd == 011 indicates register R3 ddd == 100 indicates register R4 ddd == 101 indicates register R5 ddd == 110 indicates register R6 ddd == 111 indicates register R7