CPD¶
- CPD
- Compare and Decrement
- Description
- Performs
cp a,(hl)
, then decrementsHL
andBC
.cp a,(hl) dec hl dec bc
- Uses
- This instruction is not very useful on its own, as
cp a,(hl)
is both smaller and faster than a singleCPD
, but more often used is the repeating version ofCPD
:CPDR
- This instruction is not very useful on its own, as
- Results
Register/Flag 16-bit (non-ADL) 24-bit (ADL) S
flagSet if result is negative; else reset Z
flagSet if A
=(HL)
; else resetH
flagSet if borrow from bit 4; else reset P/V
flagSet if BC
≠ 0 after the operation; else resetN
flagSet C
flagNot affected - Allowed Instructions
Instruction Opcode CC (ADL/non-ADL) CC (.S) CC (.L) cpd $ED, $A9 2F + 1R 3F + 1R 3F + 1R - See Also
- CP, CPDR, CPI, CPIR, LDD