How to Use Debug CPU App - A simulated CPU for embedded system Debugging of Z80, 6502, 6811, or 8096 CPUs

To use Debug CPU, start by downloading the Windows app to your Windows computer.

Download Debug Z80 (DebugZ80Install.msi) for 32-bit Windows (works on 64-bit Windows)
Download Debug AVR (DebugAVRInstall.msi) for 32-bit Windows (works on 64-bit Windows)
Download Debug 6502 (Debug6502Install.msi) for 32-bit Windows (works on 64-bit Windows)
legacy: Download Debug 6811 (11Dbg11.zip) for 16-bit Windows (should work on 32-bit Windows)
legacy: Download Debug 8096 (96Dbg11.zip) for 16-bit Windows (should work on 32-bit Windows)

DebugCPUs (Debug CPU) are simulated Z80, AVR, 6502, 6811, and 8096 CPU Debuggers that might be helpful to the hobbyist who wishes to develop and debug code for a Z80, AVR, 6502, 68HC11, or 80x96 CPU. The current implementation supports commands similarly to those that existed in DOS debug.

The DebugZ80 and Debug6502 version 1.2* or greater apps are 32-bit Windows applications that can run on 32-bit or 64-bit Windows. The older Debug6811 and Debug8096 version 1.1* apps are 16-bit Windows applications that can run on 16-bit or 32-bit Windows, but not 64-bit Windows. If you're interested in more recent builds of Debug6811 or Debug8096, contact us at teraKUHN and we can discuss making them available.

Disclaimer, Comments on Shareware, and Copyright

Debug CPU is distributed 'as is', so the user bears all responsibility for testing that the functionality is acceptable. Use Debug CPU at your own risk. If this software has undesired effects, your sole recourse is to discontinue use of it. That said, we hope you enjoy using this software and are able to get some practical work accomplished with it. Feel free to write to us if you have questions, suggestions, feeback, or bug reports regarding it. Contact us at teraKUHN.

Debug CPU is a shareware program. Please help more people learn about it by pointing friends, classmates, and co-workers at the download location for them to try it. Please do not redistribute it on your own. If you use Debug CPU on a regular basis, you are required to register it. With a registration you will receive an email notification when the next version of the software is available. To register through PayPal send $5.50 US to teraKUHN@yahoo.com with the program name 'Debug {CPU}' in the note to seller. Alternatively send a check for $5.00 US payable to R. J. Kuhn and a note with your email address and the program name 'Debug {CPU}' to:
PO Box 372
Redmond, WA 98052

Copyright (C) 1997 - 2000, 2020 R. J. Kuhn - All Rights Reserved

Debug CPU help

Load machine code

You can load *.hex, *.rom, or *.bin memory files into the simulated CPUs main program memory space through two different ways. The simpler approach is to load *.hex or *.rom files that have the machine code you want to debug by loading them through the file open menu or by specifying the file as an argument when starting the Debug CPU executable (Dbg{CPU}.exe). The other way is to list the memory files in the Debug CPU initialization file (Dbg{CPU}.ini) located in the same directory as the executable. The entries in the Debug CPU initialization file include lines that have the path to the memory file followed by ' 0 0', or for *.bin files the path to the memory file followed by the 16-bit load address and the 16-bit size of the binary.

ex:
..\BASIC.hex 0 0
EPROM.bin 2000 1000
TEST.rom 0 0

Note that a *.rom file is similar to a *.bin binary file, except that it starts with 2 bytes indicating the 16-bit load address followed by 2 bytes indicating the 16-bit size of the binary followed by the actual binary data. Since *.hex and *.rom files have their load address embedded in the files, they can be loaded with File Open; however, loading a *.bin binary file needs the load address specified in the Debug CPU initialization file.

Debug machine code

Debug CPU uses a text window to allow the user to enter commands and inspect the state of the CPUs memory, I/O, and registers. The text window takes single line commands at the end of the text that are described with the following syntax:

Operation Command Syntax
quick help ?
breakpoints B [addresses]
compare memory C range address
dump memory - hex D [range]
dump memory - octel 8 [range]
dump Output/RAM O [range]
enter memory E address [list]
enter Input/RAM I address [list]
go G [=address] [addresses]
move memory M range address
proceed P [=address] [addresses]
register R
trace T [=address] [value]
unassemble U


where all fields in [] are optional and the fields have the following meaning:
B - breakpoints - Use this command to set breakpoints where you want execution to stop and to echo out what breakpoints are set. This command can set new breakpoints in the program's code, but will not clear any existing breakpoints. Breakpoints can only be set at an address containing the first byte of a valid instruction. Note that DebugCPU replaces the original instructions of any listed breakpoint addresses with a halt, break, or software interrupt. The instruction at these locations are restored to their original value if the breakpoint is encountered or when the G command is next used. If DebugCPU does not hit a breakpoint, then the breakpoint is still enabled.
C - compare memory - use this command to compare a range of memory to memory at another location.
D - dump memory - use this command to report what is stored in main program memory in hexidecimal.
8 - octel dump - use this command to report what is stored in main program memory in octel.
O - dump Output/RAM - use this command to report what has been received by IO ports.
E - enter memory - use this command to modify what is stored in main memory.
I - enter Input/RAM - use this command to modify what has been sent to IO ports.
G - go - Use this command to start executing code in the debugger. This is the same as selecting Go in the menu command. This command will clear any existing breakpoints and can set new breakpoints in the program's code.
M - move memory - use this command to move a range of memory to another location.
P - proceed - Use this command to continue executing code in the debugger. This is the same as selecting Proceed in the menu command. This command can set new breakpoints in the program's code, but will not clear any existing breakpoints.
R - register - use this command to report what is stored in registers.
T - trace - Use this command to execute one or more instruction in the debugger. This is the same as selecting Step or Trace in the menu command. This command will not clear any existing breakpoints.
U - unassemble - use this command to report what CPU opcodes are stored in main program memory.

address - a 16-bit hexidecimal memory address
addresses - a sequence of up to 8 16-bit hexidecimal memory addresses
value- an 8-bit hexidecimal data value
list - a sequence of up to 8 8-bit hexidecimal data values
=address - =# where # is a 16-bit hexidecimal memory address where something will start
range - either 2 16-bit hexidecimal memory addresses indicating start and end or 1 16-bit hexidecimal memory address indicating start and L # where # is the length to end

In addition to entering single line commands at the end of the text window the Go, Proceed, and Trace commands can be entered through menu commands.

Commands

File menu commands
The File menu offers the following commands:

Reload New Reloads memory and resets processor.
Reset Resets processor.
Open Opens an existing document.
Save Saves an opened document using the same file name.
Save As Saves an opened document to a specified file name.
Exit Exits SimpCB.

Edit menu commands
The Edit menu offers the following commands:

Undo Reverse previous editing operation.
Copy Copies data from the document to the clipboard.
Paste Pastes data from the clipboard into the document.
Find Searches for characters or words in a document.
Repeat Repeat the last search or replace.

View menu commands
The View menu offers the following commands:

Toolbar Shows or hides the toolbar.
Status Bar Shows or hides the status bar.

Project menu commands
The Project menu offers the following commands:

Options Set Options.
Go Start executing code in the debugger.
Stop Debug Stop executing code in the debugger.
Step Single Step into next instruction.
Proceed Continue executing with the next instruction.

Help menu commands
The Help menu offers the following commands, which provide you assistance with this application:

Online Help Offers you a link where you can get help.
About Displays the version number of this application.

Text Copyright (C) 2020 R. J. Kuhn. Please note that you are not allowed to reproduce or rehost this page without written permission.