comp.sys.sinclair FAQ
Hardware Ports

When an port is read from (with 'IN') or written to (with 'OUT'), it will activate a number of devices external to the Z80, depending on the port address. In general, devices respond if certain bits in the binary representation port number are set and/or reset, rather than to a specific port number; this is known as 'partial decoding'. Whilst this makes the decoding hardware easier to make, it does mean that a considerable amount of congestion has occured in the space available for new peripherals to respond to if they do not wish to clash with any current devices.

The next complication is to do with the Z80's I/O instructions: it is quicker and easier to select the low 8 bits of the port number than it is to select the high 8 bits; this means that, when outputting to peripherals for which the upper 8 bits make no difference, this will often be left unset, and may contain garbage. Thus, the 48K ULA, which responds to all even port addresses, is often referred to as Port #FE, rather than the full 16-bit port #FFFE.

Port Specifications:
Listed below are some of the available peripherals (including those like the ULA, which are in every machine), and the bit fields to which they respond. In the table, '-' means 'don't care', '0' means the bit must be reset for the peripheral to respond, and '1' means it must be set.

  • Peripheral: Timex TS-2068 Display mode.
  • Port: ---- ---- 1111 1111

  • Peripheral: 48K ULA.
  • Port: ---- ---- ---- ---0 More information.

  • Peripheral: Timex TS-2068 ULA.
  • Port: ---- ---- 1111 1110 Same as 48K ULA.

  • Peripheral: 128K AY Register.
  • Port: 11-- ---- ---- --0- More information.

  • Peripheral: 128K AY Data.
  • Port: 10-- ---- ---- --0- More information.

  • Peripheral: ZX Spectrum +2a / +3 Memory
  • Port: 01-- ---- ---- --0- More information.

  • Peripheral: ZX Spectrum 128K / +2 Memory
  • Port: 0--- ---- ---- --0- More information.

  • Peripheral: +3 FDC Data.
  • Port: 0011 ---- ---- --0- More information.

  • Peripheral: +3 FDC Status.
  • Port: 0010 ---- ---- --0- More information.

  • Peripheral: +3 Memory.
  • Port: 0001 ---- ---- --0- More information.

  • Peripheral: +3 Centronics.
  • Port: 0000 ---- ---- --0-

  • Peripheral: ZX Printer.
  • Port: ---- ---- ---- -0--

  • Peripheral: Timex TS-2040 / Alphacom 32 Printers.
  • Port: ---- ---- 1111 1011

  • Peripheral: ZX Interface I RS232/Network.
  • Port: ---- ---- ---1 0--- More information.

  • Peripheral: ZX Interface I Control.
  • Port: ---- ---- ---0 1--- More information.

  • Peripheral: ZX Interface I Microdrive.
  • Port: ---- ---- ---0 0--- More information.

  • Peripheral: Timex TS-2068 AY Data.
  • Port: ---- ---- 1111 0110

  • Peripheral: Timex TS-2068 AY Register.
  • Port: ---- ---- 1111 0101

  • Peripheral: Timex TS-2068 Horizontal Select Register.
  • Port: ---- ---- 1111 0100

  • Peripheral: Aerco Centronics Interface.
  • Port: ---- ---- 0111 1111

  • Peripheral: Kempston Joystick.
  • Port: ---- ---- 000- ---- More information.

  • Peripheral: JLO Status/Command.
  • Port: ---- ---- 1000 1111

  • Peripheral: JLO Track.
  • Port: ---- ---- 1001 1111

  • Peripheral: JLO Sector.
  • Port: ---- ---- 1010 1111

  • Peripheral: JLO Data.
  • Port: ---- ---- 1011 1111

  • Peripheral: JLO Select.
  • Port: ---- ---- 1011 0111

| special thanks to Jonathan Needle for providing updated ZX Spectrum 128K / +2 Memory entries |

If you can contribute any information, please contact us. You will be credited for your submission.