out
Output
Writes A or another register to an I/O port, addressed by BC or by A and nn.
2 bytes
- Ports: in and outZ80 assembly
- The screen, keyboard and mouse through portsZ80 assembly
- Print a stringZ80 assembly
- Read two numbers and print their sumZ80 assembly
- Convert a number to a string in any baseZ80 assembly
- Drawing shapes on the screenZ80 assembly
- A bouncing ballZ80 assembly
- Move a square with the keyboardZ80 assembly
- The snake gameZ80 assembly
- Flappy ASMZ80 assembly
- Leaves every flag unchanged
Forms
out (), a11 cyclesWrites A to the port whose address has A in the high byte and
nnin the low byte.-
Writes
rto 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
nnin the low byte. -
Writes
rto 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), 012 cyclesWrites 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,
0to255or-128to127, written as a number, character constant or symbol. More r- An 8-bit register:
a,b,c,d,e,horl.
.org 0x8000
ld a, 'H'
out (0x10), a ; the character port prints the byte as a character
halt