in
Input
Reads a byte from an I/O port into a register, with the port addressed by BC or by A and nn.
- Ports: in and outZ80 assembly
- The screen, keyboard and mouse through portsZ80 assembly
- Read two numbers and print their sumZ80 assembly
- A bouncing ballZ80 assembly
- Move a square with the keyboardZ80 assembly
- The snake gameZ80 assembly
- Flappy birdZ80 assembly
- Play a tuneZ80 assembly
- ChiptuneZ80 assembly
- ● 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 unchangedA byte from the port whose address is formed by A in the high bits and
nnin 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
nnin 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 cyclesInputs 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,
0to255or-128to127, written as a number, character constant or symbol. More r- An 8-bit register:
a,b,c,d,e,horl.
.org 0x8000
in a, (0x11) ; ask the console for a number
add a, a ; double it
out (0x11), a ; print the result
halt