Sega Master System / Mark III / Game Gear
There are two ways for data to get into and out of the Z80 CPU (and most other CPUs): the memory and I/O buses.
The memory bus is a 16-bit address bus with 8 data bits, giving 64KB of byte-accessed memory or memory-mapped hardware. It is intended for fast accesses. You access memory using the
ld instructions, for example:
It is generally mapped to ROM and RAM, although memory-mapped hardware can be set up to be accessed in the same way.
The I/O bus is an 8-bit address bus with 8 data bits, intended for communication with external devices and more complex hardware. It is intended for slower accesses. You access memory using the
out instructions, for example:
It is generally used for everything but ROM and RAM, such as video hardware, I/O, etc.