inir

Input, increment and repeat

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

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

SZHP/VNC ?1??1?
  • 1 always 1
  • ? undefined afterwards

Forms

  • inir

    A byte from the port at the 16-bit address contained in the BC register pair is written to the memory location pointed to by HL. Then HL is incremented and B is decremented. If B is not zero, this operation is repeated. Interrupts can trigger while this instruction is processing. Note that the carry flag may be affected, contrary to documentation. Read More

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