# `lddr`

[Z80 Documentation](https://asm-editor.specy.app/documentation/z80.md) › [Instructions](https://asm-editor.specy.app/documentation/z80/instruction.md)

Web page: https://asm-editor.specy.app/documentation/z80/instruction/lddr

**Load, decrement and repeat**

Category: Block and string

Copies bytes from (HL) to (DE), decrementing HL, DE and BC, until BC is zero.

2 bytes · 21/16 cycles · 21 cycles for a pass that repeats, 16 for the last

## Flags

| Flag | Effect |
| --- | --- |
| S | not changed |
| Z | not changed |
| H | always 0 |
| P/V | always 0 |
| N | always 0 |
| C | not changed |

## Forms

- `lddr` · Transfers 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. If BC is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing.

## Example

```z80
        .org 0x8000
        ld hl, source + 3
        ld de, 0x9000 + 3
        ld bc, 4
        lddr
        halt
source: .byte 1, 2, 3, 4
```
