9.1I/O addressing
The idea
The CPU can reach devices in two ways: memory-mapped I/O (device registers look like memory) or isolated I/O (a separate port space with IN/OUT instructions).
Think of it like this: Mail addressed to ordinary house numbers (memory-mapped) versus a separate P.O. box system (isolated).
Why it exists
The choice decides which instructions can talk to devices.
How it works
- Memory-mapped: use normal LOAD/STORE, the decoder routes the address to the device.
- Cost: uses up part of the memory address space.
- Isolated: special IN/OUT instructions plus a control signal for I/O space.
- Benefit: full memory space left for memory.
Worked example: Reading a status register
Memory-mapped: LOAD R1,[0xFF00]. Isolated: IN R1,0x20.
Now play with it
- →Switch tabs and compare the signals involved.
- CPU executes an ordinary LOAD R1, [0xFF00]
- 0xFF00 goes on the address bus
- Decoder: address is inside the device range, so it selects the device instead of RAM
- Device register value returns on the data bus, and no special I/O instruction was needed
Cost: device registers use up part of the address space.
Check yourself
Which instructions does memory-mapped I/O use to talk to devices?
Exam notes (the dense version)
Memory-mapped: devices share the address space (use normal LOAD/STORE). Isolated (port-mapped): separate address space, special IN/OUT instructions.
Previous year questions: I/O Interface, Interrupts & DMA (8)
PYQs are grouped by topic, so this is the full set for I/O Interface, Interrupts & DMA; try the ones that match this subtopic. Open all 8 on the topic page.