ldd
Load and decrement
Copies the byte at (HL) to (DE), then decrements HL, DE and BC, setting P/V while BC is not zero.
2 bytes · 16 cycles
SZHP/VNC ––0●0–
- ● set from the result
- 0 always 0
- – not changed
Forms
lddTransfers a byte of data from the memory location pointed to by HL to the memory location pointed to by DE. Then HL, DE, and BC are decremented. p/v is reset if BC becomes zero and set otherwise.
.org 0x8000
ld hl, source + 3
ld de, 0x9000 + 3
ld bc, 4
ldd
halt
source: .byte 1, 2, 3, 4