LDDR
Exchange, Block Transfer and Search Group
Expansion:
LoaD Decrement Repeated
Usage:
lddr
The LDDR (Load and Decrement Repeat) instruction in the Z80 microprocessor is used to copy a byte from the address pointed to by the HL register pair to the address pointed to by the DE register pair, then decrement both HL and DE, and also decrement BC. This is repeated until BC is zero.
| Instruction | Description | Opcode |
|---|---|---|
| LDD | LoaD Decrement | EDB8 |
Example
; Example
ld hl, $4000 ; source address (start of screen memory)
ld de, $6000 ; destination address (anywhere in RAM)
ld bc, $1800 ; number of bytes to copy (size of screen memory)
lddr ; perform LDDR operation
; end of program
halt ; halt the processor