← 🔌 I/O Interface, Interrupts & DMA
Subtopic 1 of 8

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

  1. Memory-mapped: use normal LOAD/STORE, the decoder routes the address to the device.
  2. Cost: uses up part of the memory address space.
  3. Isolated: special IN/OUT instructions plus a control signal for I/O space.
  4. 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-
Address bus-
Decoder-
Device registerstatus = READY
  • 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?

Remember: Memory-mapped: shared address space. Isolated: separate with IN/OUT.
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.