Ruud wrote:
... prefer BigEd's BBC emulator.
But sadly there's no built-in monitor or debug. In fact I don't think I've yet run a 65816 single-stepper. There are several possible ways forward:
-
Daryl's Sysmon (SBC monitor) can do most things
-
Jammon might be good but I haven't yet seen it working (based on C64/SuperCPU)
- The Apple II gs has a
ROM-resident monitor, so a GS emulator like
KEGS,
MESS or
Florence should be able to run that
- Each of those GS emulators also have a debugger at the emulator level - it might be possible to boot into your own code and single-step it, without needing any I/O or machine initialisation
- There are also SNES emulators out there.
- running any emulator, including one based on lib65816, inside gdb might allow for some means of single stepping, dumping machine state and setting breakpoints. If there's a function to print machine state, that could be called (I think) from gdb.
- finally, it's surely possible to write a debugger for lib65816 (but I'm not likely to do it)
For me, probably booting a GS emulator and trying the Apple monitor would be the first tactic to try. It
looks like I did have KEGS running BASIC a year ago, so it shouldn't be too hard to do that.
Edit: turns out to be easy to download and run KEGS - even with a ROM, it's just about possible to use the emulator's debugger to load code, single step it and see the machine state. (Middle-mouse to get into the debugger - some trouble with the way it reads some extra junk character on each newline, so I cleaned up the following a bit.)
This is on Windows, but using cygwin:
Code:
$ echo ea200000|xxd -r -p > test.dmp
> 0ultest.dmp
Unix commands
Loading..About to open: test.dmp,len: 8
Read/write: addr 000000 for 20000 bytes, ret: 4 bytes
> 0l
1=m 1=x 1=LCBANK
00/0000: ea NOP
00/0001: 20 00 00 JSR $0000
00/0004: 00 00 BRK $00
> ^E
PC=00.0001 A=0000 X=0000 Y=0000 P=134 S=0133 D=0000 B=00,cyc:8089250.144
> s
leaving run_prog, halt_sim:0
PC=00.0000 A=0000 X=0000 Y=0000 P=134 S=0131 D=0000 B=00,cyc:8089250.188
00/0000: ea NOP
> h
KEGS Debugger help (courtesy Fredric Devernay
General command syntax: [bank]/[address][command]
e.g. 'e1/0010B' to set a breakpoint at the interrupt jump pt
Enter all addresses using lower-case
As with the IIgs monitor, you can omit the bank number after
having set it: 'e1/0010B' followed by '14B' will set
breakpoints at e1/0010 and e1/0014
g Go
[bank]/[addr]g Go from [bank]/[address]
s Step one instruction
[bank]/[addr]s Step one instr at [bank]/[address]
[bank]/[addr]B Set breakpoint at [bank]/[address]
B Show all breakpoints
[bank]/[addr]D Delete breakpoint at [bank]/[address]
[bank]/[addr1].[addr2] View memory
[bank]/[addr]L Disassemble memory
P Dump the trace to 'pc_log_out'
Z Dump SCC state
I Dump IWM state
[drive].[track]I Dump IWM state
E Dump Ensoniq state
[osc]E Dump oscillator [osc] state
R Dump dtime array and events
T Show toolbox log
[bank]/[addr]T Dump tools using ptr [bank]/[addr]
as 'tool_set_info'
[mode]V XOR verbose with 1=DISK, 2=IRQ,
4=CLK,8=SHADOW,10=IWM,20=DOC,
40=ABD,80=SCC, 100=TEST, 200=VIDEO
[mode]H XOR halt_on with 1=SCAN_INT,
2=IRQ, 4=SHADOW_REG, 8=C70D_WRITES
r Reset
[0/1]=m Changes m bit for l listings
[0/1]=x Changes x bit for l listings
[t]=z Stops at absolute time t (obsolete)
S show_bankptr_bank0 & smartport errs
P show_pmhz
A show_a2_line_stuff show_adb_log
Ctrl-e Dump registers
[bank]/[addr1].[addr2]us[file] Save mem area to [file]
[bank]/[addr1].[addr2]ul[file] Load mem area from [file]
v Show video information
q Exit Debugger (and KEGS)
>