Zilog Z08470 User Manual
Page 174
Z80 Instruction Set
UM008007-0715
162
Z80 CPU
User Manual
r identifies registers B, C, D, E, H, L, or A specified in the assembled object code field, as
follows:
Description
The contents of the s operand are compared with the contents of the Accumulator. If there
is a true compare, the Z flag is set. The execution of this instruction does not affect the
contents of the Accumulator.
Condition Bits Affected
S is set if result is negative; otherwise, it is reset.
Z is set if result is 0; otherwise, it is reset.
H is set if borrow from bit 4; otherwise, it is reset.
P/V is set if overflow; otherwise, it is reset.
N is set.
C is set if borrow; otherwise, it is reset.
Example
If the Accumulator contains
63h
, the HL register pair contains
6000h
, and memory loca-
tion
6000h
contains
60h
, the instruction CP (HL) results in the PN flag in the F Register
resetting.
Register
r
B
000
C
001
D
010
E
011
H
100
L
101
A
111
Instruction
M Cycles
T States
4 MHz E.T.
CP r
1
4
1.00
CP n
2
7(4, 3)
1.75
CP (HL)
2
7 (4, 3)
1.75
CP (IX+d)
5
19 (4, 4, 3, 5, 3)
4.75
CP (lY+d)
5
19 (4, 4, 3, 5, 3)
4.75