36
Rabbit 2000/3000 Microprocessor
Description
Compares the data in A with the data in register r (any of the registers A, B, C, D, E, H, or L). This compare
is accomplished by subtracting the data in register r from 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=V
Where “x” is the data in register r and “V” indicates that the overflow flag is set on an arithmetic overflow
result. That is, the overflow flag is signalled 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 if A contains 0x80 and
you're comparing it to 0x01 the overflow flag will be set.
This operation does not affect the data in A.
CP
r
Opcode
Instruction
Clocks
Operation
——
BF
B8
B9
BA
BB
BC
BD
CP
r
CP A
CP B
CP C
CP D
CP E
CP H
CP L
2
2
2
2
2
2
2
2
A -
r
A - A
A - B
A - C
A - D
A - E
A - H
A - L
Flags
ALTD
I/O
S
Z
L/V
C
F
R
SP
S
D
•
•
V
•
•
Summary of Contents for 2000
Page 2: ...ii Rabbit 2000 3000 Microprocessor...
Page 4: ...iv Rabbit 2000 Microprocessor...
Page 16: ...12 Rabbit 2000 3000 Microprocessor...
Page 164: ...160 Instruction Reference Manual...