The original ZX Spectrum keyboard consists of 40 keys arranged as eight half-rows of five keys. The keyboard is read through the ULA using the address and data buses.
| Address | Port | D0 | D1 | D2 | D3 | D4 |
|---|---|---|---|---|---|---|
| A8 | 65278 | |||||
| A9 | 65022 | |||||
| A10 | 64510 | |||||
| A11 | 63486 | |||||
| A12 | 61438 | |||||
| A13 | 57342 | |||||
| A14 | 49150 | |||||
| A15 | 32766 |