Debugger for my PET 2001 online emulator

Maybe of interest to anyone who (a) wants to explore PET programs, including the workings of MS BASIC, or (b) wants to fiddle around with 6502 code in the context of a complete, but relatively simple machine: The PET 2001 emulator now features a debugger/monitor.

While the PET features a machine language monitor of its own in ROM, this one specializes in exploring code and in reverse engineering. E.g., an annotation to the current instruction resolves operands to effective values. So that you know that “LDA ($FE),Y” will be actually loading the value “$04” into the accumulator. Moreover, there’s also a browsable disassembly, showing the context of the current instruction. Meaning, while the trace log shows you what has happened previously, this one shows you the things to come.
There is also a “Next Block” function that allows you to skip through code until the next JMP, JSR, interrupt or return instruction. You may also disable the tracing of any interrupt routines, which is actually the default option. (Supposing, you’re probably more interested in the main thread of the code than in the reocuring system service routines.)

To protect the innocent, editing of the CPU status is hidden behind a lock icon and any memory locations (shown in the “Stack” and “Memory” displays) are editable by right-clicks.
(Generally, this should be pretty self-explanatory and there are hints and tool tips, wherever this may be required.)


(The debugger panel at the right, here in dark mode and the “Code” tab with disassembly active.)

The debugger is accessible by an icon (you’ll probably guess, which one this is) at the top right corner of the page (which is shown only, if there’s sufficient space to the right of the emulated PET, in order to display the debugger.)
Since the emulator also features a (simple) drag-and-drop 6502 assembler, this may be a fun environment to play around with some 6502 code…

Have fun!

4 Likes

And here is (finally) a blog post on the debugger and its features, in the guise of a visual tour:

2 Likes