ldi

Load and increment

Copies the byte at (HL) to (DE), increments HL and DE and decrements BC, setting P/V while BC is not zero.

2 bytes16 cycles

SZHP/VNC ––0●0–
  • ● depends on the result
  • 0 always 0
  • – not changed

Forms

  • ldi

    Transfers a byte of data from the memory location pointed to by HL to the memory location pointed to by DE. Then increments HL and DE and decrements BC. Resets the parity/overflow flag if BC becomes zero, and sets it otherwise.

        .org 0x8000
        ld hl, source
        ld de, 0x9000
        ld bc, 4
        ldi
        halt
source: .byte 1, 2, 3, 4