Keyboard and encoder/controller (from Wakerly)
Interfaces usually have their own sets of registers or ports. We have already mentioned some of
the registers on the 8259A interrupt controller. In general, controllers include one or more status
and control registers. A particular controller may also have more "special purpose" registers,
such as the IMR, ISR, and vector number registers we saw on the 8259A. Other common
registers are transmit and/or receive registers (buffers). The exact number and kind of registers
depends on the device. For example, a video controller may have a cursor register for
coordinates of the cursor.
Communication between the device and the CPU depends on two different (but equally
necessary) factors. First, are the control lines between the device and the CPU. Second, are the
I/O ports, which you should think of as memory locations, but which are typically registers, to
which both the device and the CPU have access. The two basic types of interface for these
registers or ports are isolated I/O and memory mapped I/O.
Isolated I/O
Isolated I/O requires special I/O instructions. Since they have less general requirements than
normal MOVE instructions and they require fewer memory accessing modes, they require less
circuitry to execute. As a result, they are faster than standard MOVE instructions. We can say
they are optimized for I/O. Typically, the mnemonics for these instructions are IN and OUT, as
they are for the Intel family of chips. True isolated I/O also requires a dedicated I/O bus, separate
from normal data and address buses. Having separate buses for I/O means that bus cycles can
occur simultaneously for conventional memory and I/O devices. This reduces bus contention and
provides better performance.