As the 6502 has the 65816, so the Z80 has the Z180. The approach to addressing more than 64k of memory is interesting, and minimal: nothing changes in the instructions or operands, but instead mappings are applied to two areas in the 64k space. From address 0 to the first area is not mapped, so you get 3 regions in all, conventionally called
- common 0
- bank 1
- common 1
Common 0 is indeed common to all maps - if different mappings are different processes, then they share some lower part of memory space. In the Z80, low memory is for ROMs, vectors and OS, so this is like sharing the top of memory in a 6502 system.
(I don't see that Common 1 is actually common between maps. Also note that common 0 can be empty, with bank 1 starting at address 0)
The granularity is 4k, so only 4 bits are needed to define each of the two boundaries. So there's a single mapping register of 4+4 bits for that. The mapping registers are 8 bits(*), so the physical address gets 12 bits from the logical address, and 8 bits as a result of adding the map to the logical address.
(*) Maybe only 7, but they could have been 8!
The total exposed interface to the MMU then is just 3 8-bit registers: CBAR for the bounds, CBR and BBR for two base addresses.
See
http://www.ganssle.com/articles/ammu.htm and
http://www.miredespa.com/sb180/HD64180.WS for more. The second of those contains some diagrams such as this:
Code:
o BBR (Bank Base Register) specifies high-seven bits
of 19-bit effective address of Bank Area; if
16-bit address is in Bank Area (high 4 bits
>= CBAR low and < CBAR high), then add BBR to
high 4 bits to get high 7-bits of address
16 Bits Total
-------------------------------
Logical Address | High 4 | Lower 12 Bits |
-------------------------------
+ |
----------------- |
BBR | Hi 3 | Low 4 | |
----------------- |
| |
| |
V V
19 Bits Total
--------------------------------------
Physical Address | High 7 Bits | Lower 12 Bits |
--------------------------------------
As we know, the 65816's banking approach gives access to a 24-bit address space. To do the same here would require some adjustment and some more width in the MMU registers.