eZ80
®
CPU
User Manual
UM007714-0908 CPU Instruction Set
118
CP A, (HL)
Compare with Accumulator
Operation
A–(HL)
Description
The (HL) operand is an 8-bit value stored at the memory location specified by the contents
of the multibyte register HL. This 8-bit value is compared with (subtracted from) the con-
tents of the accumulator, A. The execution of this instruction does not affect the contents
of the accumulator or the (HL) operand.
Condition Bits Affected
Attributes
S Set if result is negative; reset otherwise.
Z Set if A = (HL); reset otherwise.
H Set if borrow from bit 4; reset otherwise.
P/V Set if overflow: reset otherwise.
N Set.
C Set if borrow; reset otherwise.
Mnemonic Operand ADL Mode Cycle Opcode (hex)
CP A,(HL) X 2 BE
CP.S A,(HL) 1 3 52, BE
CP.L A,(HL) 0 3 49, BE