Quick update:
I decided to go with the mist64 version of mbasic as that works under cc/ca65. I considered modifying an existing assembler to ready MACRO code, which is not difficult, but this seems like something that is likely to make other people less inclined to try it. And the mist64 version is close enough to the original to fit my needs.
I’ll definitely be testing using the online PET emulator, which is my platform of choice for “canonical” MS BASIC. But I also wanted something even more generic and local, so I went looking for a really simple 6502 emulator platform. I did look at Sysmon, but I’m not a Java guy.
So I’m currently using bsoz, which is only a couple of pages of C code. It has versions of the Apple I and KIM-1, but the KIM code is missing the terminal emulation so it’s not all there yet. I don’t think that will be a major issue.
I have added the ability to load ROMs using positional parameters:
bsoz kim1.rom@0 mbasic.rom@2000
Now I’m working on statistics and I’m looking for input here. I have added the underlying code - just a table of 256 32-bit words that hold the number of times any particular opcode is called.
But my concern is that it’s either on or off right now, and that’s not really what I need - I want to benchmark particular bits of work in mbasic, not things like how many cycles it burned printing “H”.
This is something you can do in a debugger by issuing “trace on” or somesuch, but ideally I’d like to automate this on the command line so I can automate collection.
I’m wondering if anyone has any suggestions on how I might do this?
I thought of added a switch like --trace 0200-0400,600-780 and such, but that seems like something that would grow to infinite size in real-world use.
I also thought of adding fake opcodes for things like trace-on and print-stats, but that would require modifying the original source and I’m souring on that approach.
Anyone have any ideas?