PIO
The programmed input-output (PIO) is a module that serves as an interface to connect generic devices to the CPU. It is based on Intel's PPI 8255 in "mode 0," but with some modifications to simplify its operation.
It has two programmable 8-bit ports (A and B). The available registers are:
PA
(address30h
in the I/O memory),PB
(address31h
in the I/O memory),CA
(address32h
in the I/O memory),- and
CB
(address33h
in the I/O memory).
The value of port A is stored in the PA
register, and its configuration is stored in the CA
register. The CA
register is also 8 bits and tells the PIO the mode of each bit: a 0
if it's an output, and a 1
if it's an input. For example, with CA = 00001111b
, the four most significant bits are outputs, and the four least significant bits are inputs. Port B works in the same way.
The PIO can be connected to switches and LEDs or to a printer.