![]() |
|
| << Previous | Next >> | |
| | |
CP (HL) Compare Rabbit 4000/5000 InstructionDescription
Compares A with the data whose address is in HL. These compares are accomplished by subtracting the data from A. (This operation does not affect A.) The result is:
A < x : S=1, C=1, Z=0, L/V=V
A = x : S=0, C=0, Z=1, L/V=V
A > x : S=0, C=0, Z=0, L/V=Vwhere "x" is addressed data and "V" indicates that the overflow flag is set on an arithmetic overflow result. That is, the overflow flag is set when the operands have different signs and the sign of the result is different from the argument you are subtracting from (A in this case). For example, the overflow flag will be set if A contains 0x80 and you are comparing it to 0x01. The result of the subtraction is 0x7F, which has a different sign than 0x80.
The Rabbit 4000/5000 assemblers view "CP A,(HL)" and "CP (HL)" as equivalent instructions.
The opcode for this instruction is different than the same instruction in the Rabbit 2000, 3000 and 3000A.
| Rabbit Instructions | << Previous | Next >> | rabbit.com |