I was wondering if processor registers and IO registers are the same concept?
Are they registers in CPU or in some IO devices?
I picked up IO registers from this Super User question.
Processor registers - generally, something to do with any operation that the CPU does must be in one of its registers.
For example, look at this. It's the various forms of the Intel x86
RISC CPU's such as ARM are even less flexible. Data from memory must always be copied to a register as a separate operation before the CPU can do anything like
I/O registers - generally, something to do with any operation that an I/O chipset or device does must be in one of its registers.
For example, look at this. It's detail about the standard VGA "CRTC registers." Of particular interest is the "Start Address High" and "Start Address Low" registers. The values in these registers tell the VGA where to begin reading memory to render a display.
There's many ways to make I/O registers accessible from a CPU. Usually it is not like processor registers above. Various methods include:
Continuing with the example of the VGA CRTC registers above, with how I explained "I/O ports" above you are now armed with the knowledge to understand this and understand that by issuing specific
Not all I/O devices have registers. Some are really simple and just need some sort of signal to do their thing, and also "reading" the device just reports a current state. The old PC "game port" is an example. There's really no storage of data going on so it might not be technically correct to call it a register. Most technical documentation won't make this distinction, though.
You can compare the concept of an I/O register to a generic hardware register, since a register is an arbitrary term used to refer to a digital storage area. A register can act as an accumulator, hold execution information, provide an input-output buffer between devices, etc. This also means that a processor register is just a type of hardware register.
An I/O register, then, is also an abstraction of a register - it holds intermediate data moving between components. Processors do not have specific I/O registers but rather, various generic registers which can accomplish the same task (which are used, for example, when the system uses memory mapped I/O). These are used to provide a common interface bus between the CPU and the memory of the system, but in the case of MMIO, allow access to external devices' memory off of the actual address bus.
How would a programmer actually do this? They would need to determine how the external device is mapped onto the address bus of the system, and then use one of the various x86 registers to store the address (in an index/pointer register). This register could then be used (with machine instructions) to transfer data to/from another register in the processor to a register on the device.
If the CPU does not support MMIO (or the programmer decides not to use it), then in the case of x86 there can also exist special instructions for I/O from a port (which is essentially another bus). These instructions (
This is why I say that I/O registers are an abstraction of any other CPU register - they are one in the same thing. The data still moves in and out of the processor into the same registers, whether or not they are used for intermediate results, data transfer to/from the RAM, or accessing external hardware.
Depending on the motherboard layout, a CPU may access an external devices' memory through the actual address bus itself, or another bus connected to a port on the CPU. However, all of this is usually governed by the motherboard's northbridge for memory access, and southbridge for peripheral access (e.g. video cards, mouse/keyboard).
Finally, if you're familiar with the concept of DMA, external peripherals themselves can have registers designated specifically for I/O purposes from the computer's RAM. Do note that DMA basically circumvents any CPU intervention, so the concept of a processor register would not be applicable here.
Final word: Every device in your computer has a register of some kind, since no device is connected directly to the CPU - and if it was, then you would be wasting CPU clock cycles keeping the data on the bus until the device had enough time to use it (the CPU usually has the fastest clock in any system). This is just one reason why devices need a place to store data before they can work with it - and that is essentially all a register is.
Conceptually I/O registers and Processor registers are the same thing. They both are data holding units of storage for processing operations.
The difference is one of locality. I/O registers and CPU registers are all part of the same family; Hardware Registers. CPU registers live in the CPU, I/O registers live outside the CPU on your I/O devices own digital processors.
For detailed information: Hardware Registers, explains hardware registers in general, making mention of their different kinds.