in

Input

Reads a byte from an I/O port into a register, with the port addressed by BC or by A and nn.

SZHP/VNC ●●0●0–
  • ● set from the result
  • 0 always 0
  • – not changed

The rows that do otherwise show their own flags.

Forms

  • in a, () 2 bytes · 11 cycles flags unchanged

    A byte from the port whose address is formed by A in the high bits and nn in the low bits is written to A.

  • A byte from the port at the 16-bit address contained in the BC register pair is written to r.

Pseudo-instructions

Other spellings the assembler accepts; each form shows the instruction it becomes.

  • A byte from the port whose address is formed by A in the high bits and nn in the low bits is written to A.

  • A byte from the port at the 16-bit address contained in the BC register pair is written to r.

Undocumented 1 row

Left out of Zilog's manual, but the Z80 runs them, and so does this emulator.

  • in (c) 2 bytes · 12 cycles

    Inputs a byte from the port at the 16-bit address contained in the BC register pair and affects flags only.

Pseudo-instructions · Undocumented 1 row

Other spellings the assembler accepts; each form shows the instruction it becomes. Left out of Zilog's manual, but the Z80 runs them, and so does this emulator.

  • Inputs a byte from the port at the 16-bit address contained in the BC register pair and affects flags only.

Operands

nn
An 8-bit immediate value, 0 to 255 or -128 to 127, written as a number, character constant or symbol. More
r
An 8-bit register: a, b, c, d, e, h or l.
        .org 0x8000
        in a, (0x11)    ; ask the console for a number
        add a, a        ; double it
        out (0x11), a   ; print the result
        halt