inir

Input, increment and repeat

Repeats INI, reading port bytes into memory upward from HL until B is zero.

2 bytes21/16 cycles21 cycles each time it repeats, 16 the last time

SZHP/VNC ?1????
  • 1 always 1
  • ? undefined (do not rely on it)

Forms

  • inir

    Reads a byte from the port whose 16-bit address is in BC and stores it into the memory location pointed to by HL. Then increments HL and decrements B. Repeats this operation until B is zero. Interrupts can trigger while this instruction is processing.

        .org 0x8000
        ld hl, 0x9000
        ld b, 2
        ld c, 0xF0
        inir
        halt