DragonFly On-Line Manual Pages

Search: Section:  


Z80-MON(1)                        Z80 Monitor                       Z80-MON(1)

NAME

z80-mon - an interactive Z80 monitor with disassembler and emulator for UNIX, Linux and DO$

SYNOPSIS

z80-mon [-h] [-E] [-R path] [filename[:startaddress] ...]

DESCRIPTION

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 KEYBOARD-toggle). Using 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 banks. Content of registers is displayed in binary, hexadecimal and decimal scale. All addresses are displayed in hexadecimal scale. The z80-mon executes instructions exactly as the Z80 CPU. Instructions for input/output ( in, out, ini, ind, inir, indr, outi, outd, otir, otdr ) can be used to communicate with the outer-world via file descriptors. The 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 monitor. 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. On default 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) Z80-ctc availible.

ARGUMENTS

If a couple filename:address is supplied, file filename is loaded to virtual Z80 memory from address address. If file contents exceeds address 65535, it will be clipped. Any number of files can be loaded. Files are loaded sequentially, later file overwrites previous memory content.

OPTIONS

The monitor called with a -h option prints usage and exits. The option -E forces emulator mode. This means, after loading an optional Z80 executable the CPU gets a reset and starts immediately execution. Moreover keyboard input is disabled. The option -B must be followed by a filename containing a bank description and -R must be followed by a path pointing to an accessable directory which contains the binaery bank files. If omitted, the current working directory is used.

KEYS

? or h - help Shows the key help screen. Q -quit 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 cycles) # - 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, you'll 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, you'll 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 PC. 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 appears. 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 Same as u , but instead of strings you must enter bytes. Accepted numbers are described in z80-asm(5) w - defw Same as b , but instead of bytes 16-bit numbers will be stored. 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 0x first. Octal numbers are accepted too but with prefix 0. s - set SP Same as p , but changes stack pointer. m - set memory dump address Same as s or 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 tick counter , 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 program counter. 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 (type = again).

SIGNALS

Most process signals (not system signals SIGKILL, SIGSTOP, SIGCONT) are mapped to maskable interrupts. There are six exceptions: SIGTERM and SIGHUP will terminate z80-mon, SIGABRT will set the monitor in interactive dissamble mode (stops running CPU), SIGUSR1 will cause a reset and SIGUSR2 will cause a NMI. Lastly SIGTRAP will force the CPU immediately to dump its state into the file .CPU. This enables online monitoring of the running CPU.

FILES

./.CPU ./.Z80_ports ./keyboard_map The file .Z80_ports is used as buffer for the IO-port addresses, if hardware IO-buffering is enabled. The file keyboard_map is used to remap key binding for the IN instruction accessing the stdin port.

BUGS

Interrupt mode 0 isn't working. If you find some bugs, please feel free to send me a bugreport.

AUTHORS

Z80-MON was written by Brainsoft <brain@artax.karlin.mff.cuni.cz> and Achim Flammenkamp <achim@mathematik.uni-bielefeld.de>

COPYING

Copying of this software must be under terms of the GNU General Public License. There's absolutely no warranty on this software. For more details see file doc/COPY (c) 1999-2004 Brainsoft

SEE ALSO

z80-asm(1), z80-asm(5), z80-file(5), z80-ports(5), z80-banks(5) Z80-MON Version 2.4 01 Oct 2006 Z80-MON(1)

Search: Section: