out

Output

Writes A or another register to an I/O port, addressed by BC or by A and nn.

2 bytes

SZHP/VNC ––––––
  • Leaves every flag unchanged

Forms

  • out (), a 11 cycles

    Writes A to the port whose address has A in the high byte and nn in the low byte.

  • Writes r to the port whose 16-bit address is in BC.

Pseudo-instructions

The assembler also accepts these forms, which are other ways to write Z80 instructions. Open a row to see what each form becomes.

  • Writes A to the port whose address has A in the high byte and nn in the low byte.

  • Writes r to the port whose 16-bit address is in BC.

Undocumented 1 row

Zilog’s manual does not list these forms, but the Z80 runs them.

  • out (c), 0 12 cycles

    Writes zero to the port whose 16-bit address is in BC.

Pseudo-instructions · Undocumented 1 row

The assembler also accepts these forms, which are other ways to write Z80 instructions. Open a row to see what each form becomes. Zilog’s manual does not list these forms, but the Z80 runs them.

  • Writes zero to the port whose 16-bit address is in BC.

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
        ld a, 'H'
        out (0x10), a   ; the character port prints the byte as a character
        halt