out
Output
Writes A or another register to an I/O port, addressed by BC or by A and nn.
- 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
- Print a number in any base without helpZ80 assembly
- Drawing shapes on the screenZ80 assembly
- A bouncing ballZ80 assembly
- Move a square with the keyboardZ80 assembly
- The snake gameZ80 assembly
- Flappy birdZ80 assembly
- Changes no flag
Forms
out (), a2 bytes · 11 cyclesThe value of A is written to the port whose address is formed by A in the high bits and
nnin the low bits.-
The value of
ris 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
nnin the low bits. -
The value of
ris 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), 02 bytes · 12 cyclesOutputs 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,
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