Z80 hacks

The Z80's regular heartbeat of allows for creative interfacing.


breaking the 64k address limit

There are many ways to break the 64k limit of 16 address bits.
  1. bank switching
  2. For embedded systems where the program is in ROM,
    expand the address with the M1 line
    (which distinguishes instruction fetch from data memory read)
    thus 64k ROM for code, 64k RAM for data
    resulting in separate I (instruction) and D (data) spaces.

  3. build upon that with an external MMU (memory management module)
    using the M1 signal for separate I/D address space



Systems with no DRAM (dynamic memory) can exploit the refresh cycle
  1. use the R (refresh) register as free output

  2. true cycle stealing
    with memory access during the REFRESH cycle.
    Systems with separate I/D can allow data access during instruction fetch



Extend I/O address space from 8 to 16 bits by avoiding the short IN/OUT instructions.
Additional cleverness:
use upper 8 bits of the address for OUTPUT thus allowing for 16 bits in ONE CYCLE


undocumented instructions

That is very precarious because it's very chip specific,
perhaps the chip stepping/revision too.


logic analyzer vs hardware emulator

Logic Analyzer: In Circuit Emulator
  1. replaces the CPU
  2. allows you to peek inside (view registers, internal state)
    and poke at memory, alter registers, assert I/O
  3. debug programs with trace, breakpoints and watchpoints
    but beware of Heisenberg Uncertainty (observing the system interferes with timing)
  4. some were small and affordable
    such as the Nicolet Z80 NICE