out

Output

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

SZHP/VNC ––––––
  • Changes no flag

Forms

  • out (), a 2 bytes · 11 cycles

    The value of A is written to the port whose address is formed by A in the high bits and nn in the low bits.

  • The value of r is written to the port at the 16-bit address contained in the BC register pair.

Pseudo-instructions

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

  • The value of A is written to the port whose address is formed by A in the high bits and nn in the low bits.

  • The value of r is written to the port at the 16-bit address contained in the BC register pair.

Undocumented 1 row

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

  • out (c), 0 2 bytes · 12 cycles

    Outputs a zero (on NMOS Z80s) or 255 (on CMOS Z80s) to the port at the 16-bit address contained in the BC register pair. Read More

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.

  • Outputs a zero (on NMOS Z80s) or 255 (on CMOS Z80s) to the port at the 16-bit address contained in the BC register pair. Read More

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