z80-mon simulates the Z80 CPU on instruction level. It is attached with
64 KB memory, where data and instructions are stored. With the bank switching
feature it even can access more memory.
The monitor displays in the upper left content of memory,
lower left the list of instructions in front of PC, followed by the stack.
In the right half it shows in the first line the flags and status of IFF and IM.
Below follows the content of all registers together with the value of the tick
counter. The last but one line is reserved for the (up to 8) breakpoints and
finally in the last line either monitor error messages or the current status
of the monitor is displayed (FOLLOW-toggle RUN-status CPU-speed PROTO-status
z80-mon you can trace your program (and even protocol this), change
content of registers and memory, change the program, save it, load others e.t.c.
It even supports bank switching via the file
Content of registers is displayed in binary, hexadecimal and decimal scale.
All addresses are displayed in hexadecimal scale.
z80-mon executes instructions exactly as the Z80 CPU. Instructions for
in, out, ini, ind, inir, indr, outi, outd, otir, otdr ) can be used to communicate with the outer-world via file descriptors.
Halt instruction tests if the interrupt is disabled. If yes it makes an error
message and put CPU into wait, otherwise it keeps running. The Halt-pin
active symbol is displayed in both cases in the upper right corner of the
If you press the R key, flag
RUN is turned off.
Interrupt handling and bank switching is still experimental. Use signals under
UNIX/Linux or certain key strokes to generate interrupts.
z80-mon controls a Z80-cpu (with a build in oscillator) and at least 64 KB memory
including bank switching hardware;
but further hardware may be attached.
hardware. Currently there is an external
quartz ,needed for synchronisation of several components, a
daisy-chain IO-curcuit, needed for interrupt handling of several components and an (experimental)
? or h - help
Shows the key help screen.
Ends the program. Memory content will be discarded.
* - clear
clears all CPU registers, resets banks (if bank
switching was used) and finally resets the CPU.
@ - reset
resets the CPU (pin RES high for at least 3 clock
# - zero
fills whole memory with zeros
$ - null
set the tick (clock cycle) counter to zero
& - stop
set stack pointer
SP to 0xFFFC and store at this address
the value 0xFFFE followed by the 2 bytes for DI, HALT.
This serves as a fall back trap for the final RET.
% - breakpoint
set a breakpoint at memory dump address together with
a run counter. In run-mode this counter will be
decreased if positive each time its address is reached.
If it becomes 0 the CPU is immediately stopped.
L - load
Loads file to memory. After pressing this key, youll
be asked about filename. For abort press escape.
S - save
Saves memory from current address (in program
counter), first enter filename then length.
Escape aborts saving.
Backspace - execute current instruction
Executes instruction pointed by the program counter.
- set protocol file
After pressing this key, youll be asked about
filename. For abort press escape. Else it opens the file
for append and protocols each executed instruction
together with the current CPU register values. Sets the
PROTO switch. To disable the protocol mode select a new
protocol file with empty file name.
r - run
Toggle start/stop executing instructions. Effectively
toggles the WAIT-pin of the CPU. :) Also, the following
keys activate WAIT-pin:
@ s p =
R - toggle run
this stops a running CPU if it is catched in a HALT
and IFF0=1 (if monitor keyboard read is enabled).
Space - skip instruction
Moves to the next instruction.
D - disassemble
Disassemble memory from current address (in program
counter), first enter filename then length.
Escape aborts disassembling and saving.
x - execute instruction
Asks about instruction and executes it. Except jump,
call and return instructions, the
PC is not changed.
Enter - put instruction
Asks about instruction and puts it on address in
When you press the key, a prompt appears.
. - put instruction
Asks about instruction and puts it at address of
the memory dump. When you press the key, a prompt
u - defm
Puts string to memory starting at address of the
memory dump. When you press the key, a prompt appears.
Enter comma or whitespace separated list of strings.
v - defb
u , but instead of strings you must enter bytes.
Accepted numbers are described in
w - defw
b , but instead of bytes 16-bit numbers will be
p - set PC
After pressing this key you can enter new value of the
program counter. Numbers are by default in decimal
scale. For hexadecimal scale you must write prefix
first. Octal numbers are accepted too but with prefix
s - set SP
p , but changes stack pointer.
m - set memory dump address
p but affects start of the memory dump.
+ - increase clock speed
Depending on the clock speed, memory dump, stack and
instruction list may not be refreshed. At higher
frequencies only the
PC, SP and the
Halt-pin status are refreshed.
- - decrease clock speed
Tab - toggle FOLLOW
Toggles the FOLLOW switch. When the FOLLOW switch is on,
memory dump starts automatically at address in the
t - toggle disassembling of constants
Cyclic switches the constant representation base:
mixed(default), each decimal, each hexadecimal, each
hexadecimal with prexfix 0x.
j - toggle disassembling of addresses
Cyclic switches JR/DJNZ instructions between relative
and absolute, or switches all JR/DJNZ/CALL/JP and LD
memory accesses (....) into K-prefixed labels or guess
even LD 16-bit constants as labels. In the last two
cases a K-prefixed label resp. a V-prefixed label will
be generated. Also here we have a two-pass disassembler.
^ - toggle EI/DI
Toggles enable/disable interrupt.
i - change IM
Cyclic switches the interrupt mode. Values are 0, 1, 2.
Esc - generates nonmaskable interrupt
generates a nonmaskable interrupt (pin NMI of CPU high).
! - toggle keyboard read
disables monitor read from keyboard if CPU is running
(dangerous!). CPU will only stop if running into HALT
and interrupts are disabled.
= - set CPU registers
promtes for a name of an 8-bit register (A,B,C,D,E,F,
H,L,I,A or A,B,C,D,E,F,H) or a 16-bit register