Skip to main content

I/O Ports

Spectranext exposes several fixed Z80 I/O ports (addresses ending in $3B). Use the usual instructions — for example ld bc, $nn3B with out (c), a and in a, (c) — with the port numbers below.

I/O ports

$003B — Page A

Write only. Chooses which 4K page is visible in memory region A. Prefer the ROM paging helpers (for example SETPAGEA) instead of raw OUT, so paging stays consistent with the rest of the system. Details: memory.

$013B — Page B

Write only. Same role as $003B, but for region B (for example SETPAGEB).

$023B — Trap / CPLD

Read and write. Spectranet-style programmable trap address and related behaviour; reads can report hardware identity (what the CPLD reports).

$033B — Cartridge control

Read and write. Controls paging the Spectranet ROM/RAM, traps, and the register bit pattern used when detecting Spectranext.

$043B — Console I/O

Write only. Each byte you send is printed on the host console. Typical pattern: bc = $043B, then out (c), a per character. More detail: libterm and logging.

See also