Section 18.2: How I/O actually works (Frame 5)                     [prev][home][next]

While the CPU copies the value from its side of the data port into internal registers (such as the main accumulator), the TR spins in a loop looking at the CPU's status register. Until that changes to 10, the TR must wait. Finally the CPU sets its status port to 10, meaning it has taken the data byte out of the port and is done. The TR can go back to square 1 and wait for the next command.

This constant monitoring of a wire, waiting for an event, is called polling. All computer devices that have separate clocks employ polling to coordinate their actions. It is kind of like two people who are working on different parts of the same project. One is always asking the other, "Are you ready?" or "Are you done with that and ready for the next thing?" Inside the CPU's innermost mechanism, every event is synchronized to a common clock and all events have a well-defined order so polling is not necessary inside the CPU itself. Only when there is no common pulse signal and no clear ordering of events is polling absolutely necessary.