Usimdbg is a debugger written to run with Ray Bellis' mc6809 emulator Usim (https://github.com/raybellis/usim/), it is written in C++.
Command keywords are displayed in mixed case, the upper case part is the short abbreavation.
HELP
Display Help text.
RESET
Reset the processor state.
(BYte|WOrd) addr [Len expr | TO addr] [ '=' expr [, ...]]
Display, modify or fill memory.
- byte 1234 = 88 — Set a byte in memory.
- byte 0f000 len 20 = 0 — Zero a region of memory.
- byte 0 to 400 = 0ff — Set a region of memory to 0xff.
- byte 0 to 100 — Display memory as bytes.
- word c002 = expr — Set a word of memory to a value.
- word 200 = 1111,2222,3333,4444,5555,6666 — Set a sequence of words to values.
- byte 400 — Display the value of memory location 400 (display defaults to 16 bytes.)
- byte 1000 len 1000 = 00,11,22,33,44,55,66,77 — Fill a 4K of memory at 4K to 8K with a repeating pattern.
Step [expr]
Step expr instructions, (default=1) display registers before and disassembly of the executed instruction after.
Go
Go until a breakpoint condition happens.
BReak [ [ addr ] [ read ] [ value ] [ OCCURS expr ] | TBF | CLEAR expr ]
Set, display or clear Breakpoint(s)
- BR — with no args displays breakpoints with their index.
- BR CLEAR — expr clears a speific breakpoint by the index.
- BR addr — sets an execution breakpoint.
- BR addr (read|write|access) — sets a memory Read, Write or Access break point at addr.
- BR addr (read|write|access) value — sets a memory Read, Write or Access break point at addr that will only break if the memory value is value
- BR addr OCCURS n — sets an execution breakpoint, break will happen on the nth occurance of the trigger.
- BR addr (read|write|access) OCCURS n — sets a memory Read, Write or Access break point at addr, break will happen on the nth occurance of the trigger.
- BR addr (read|write|access) value OCCURS n — sets a memory Read, Write or Access break point at addr that will only break if the memory value is value, , break will happen on the nth occurance of the trigger.
- BR TBF — Breaks when the Trace Buffer is Full.
NOTE: when an OCCURS break point reaches zero count, it will break on every occurance of the trigger event.
- Regs — Display all registers.
- id [= expr] — Display or change the value of a register. Registers A, B, CC, D, DP X, Y, U, S, PC (or $)
Trace [expr | ( addr Len expr | addr TO addr) | CLEAR]
Display Trace or clear trace.
Trace expr
Trace addr Len expr
Trace addr1 TO addr2
Trace CLEAR
ASM addr [Len expr | TO addr]
Disassemble memory, if symbols are loaded they will be displayed also.
EVAL expr
Evaluate experssion and display as binary, octal, decimal hexadecimal and ASCII
LOAD '<filename> [BASE expr] [APPEND]
Load a filename into memory, filetypes: iHex, s19, raw/bin extensions, optionally adding a base value to relocate into higher memory. Also load symbols, symbols may be appended to the previously loaded set of symbols. Currently supports loading symbols from lwtools symbol file and mapfile (.sym and .map extensions)
SYMbols [addr [Len expr | TO addr] | 'prefix-text-to-match ]
Display all symbols currently loaded, a symbol matching a specific address or in a specified range of addresses or symbols matching a givent prefix
Expressions include the flowing:
- Numbers (Hex digits must start with a decimal digit)
- Math functions (+,-,*,/,%,())
- Logic functions OR,AND,XOR,Shift Right n, Shift Left n (|,&,^,<<,>>),
- Registers
A,B,CC,DP,X,Y,US,PC(or $) - **"**Symbol
The Tilde Escape feature has been extended to include:
- R — Reset the system.
- B — Break to Usimdbg
For the Percom specific debugger (see the tools/percom dir in my 6809 repo (https://github.com/JNSpears/6809.git))
- U — Un-mount a virtual disk. — enter: drive
- M — Mount a virtual disk. — enter: drive filename
This has only been built and tested on Linux, windows should work with cgywin or some other Linux tool set.
Build the Usim library (currently in my fork of Usim (https://github.com/JNSpears/usim.git) first. If the Usim and Usimdbg directorys are not in the same parent directory you will need to edit USIM_PATH in Makefile.
Features to consider implementing in the future:
- Features:
- Add cycle count to trace.
- load AS9 created symbol files.
- Triggers:
- Trigger range of addresses —
BR 400 to 480 write. - Trigger if cycle counter matches N —
BR TSC 100000. - Trigger THEN —
BR 1234 write then 8888 read. — or maybe an ARM/DISARM Trigger Action - Trigger value other than equal —
BR "state write > 12", (need relops, and bit test). - Trigger register with value.
- Trigger range of addresses —
- Trigger Actions:
- Count number of times a trigger has occured. (need display and clear functions).
- Turn trace on or off.
- Annotation at when trigger happens
- —
ANNO "WrAcia write [Entering Acia port Write function] - —
ANNO "DevCtrl x [dev control block] : "Dcb len 10