The Z80Emu program uses the Zilog Z80 CPU "in" and "out" opcodes to access devices such as the console, disk drive and printer. This article lists the CPU IO port address for the Z80Emu program's virtual devices.
The IO address space for the Z80 CPU is 8 bits giving a maximum of 256 device addresses. The IO ports can be accessed from any program running on the emulator whether CPM is running or not.
Port | Description |
10h |
TTY device status register. Bit 1 - can read byte from TTY device Bit 2 - can write byte to the TTY device |
11h | TTY device read data register |
12h |
CRT device status register. Bit 1 - can read byte from CRT device Bit 2 - can write byte to the CRT device |
13h | CRT device read data register |
14h |
COM1 device status register. Bit 1 - can read byte from COM1 device Bit 2 - can write byte to the COM1 device |
15h |
COM1 device read data register |
16h |
COM2 device status register. Bit 1 - can read byte from COM2 device Bit 2 - can write byte to the COM2 device |
17h |
COM2 device read data register |
18h |
Printer device status register Bit 2 - can write byte to the Printer device |
1Ah |
Input file device read status register. Bit 1 - can read byte from Input file device |
1Bh |
Input file device read data register |
1Ch |
Output file device read status register. Bit2 - can write byte to output file device |
30h |
COM1 read configuration register. B0, B1, B2 -control baud rate 300..38400 B3, B4 -select the data format; 7N, 7E, 7O, 8N B5 - selects one or two stop bits B6 - selects hardware handshake |
31h |
COM2 read configuration register. B0, B1, B2 -control baud rate 300..38400 B3, B4 -select the data format; 7N, 7E, 7O, 8N B5 - selects one or two stop bits B6 - selects hardware handshake |
40h |
Emulator command status register Bit 1 - can read byte from emulator command device Bit 2 - can write byte to the emulator command device Bit7 - CPM warm start after the command completes |
41h | Emulator command read data register |
48h | Read the CPM cold boot iobyte value |
70h..77h |
Disk drive control device read registers 70h -read status |
Port | Description |
11h | TTY device write data register |
13h | CRT device write data register |
15h |
COM1 device write data register |
17h |
COM2 device write data register |
19h |
Printer device write data register |
1Dh |
Outputt file device write data register |
30h |
COM1 write configuration register. B0, B1, B2 -control baud rate 300..38400 B3, B4 -select the data format; 7N, 7E, 7O, 8N B5 - selects one or two stop bits B6 - selects hardware handshake |
31h |
COM2 write configuration register. B0, B1, B2 -control baud rate 300..38400 B3, B4 -select the data format; 7N, 7E, 7O, 8N B5 - selects one or two stop bits B6 - selects hardware handshake |
40h |
Emulator command write command register. there are two commands: 0 -- clear cmd buffer |
41h | Emulator command write data register |
48h | Write the CPM cold boot iobyte value |
70h..77h |
Disk drive control device read registers 70h -write command |