Finally got to a point where I could work on integrating this into the UltiPET/MicroPET ROMs.
So, I was trying to write a small shim around the monitor, by implementing
and
such that they use the (original 6502) input/output routines from the PET ROM that I am using.
Unfortunately, the 816 mode bits are driving me
.....*****
Does
.....***** by chance refer to what comes out of the south end of a northbound
Fledermaustier?
Absolutely.
When I originally wrote Supermon 816, I had targeted my POC hardware, whose getcha and putcha BIOS API calls can be called with any combination of register widths. Since your environment (the souped-up PET) is very different, here’s a suggest procedure for making PET “kernal” ROM calls. The below code includes a call to the PET’s getin sub for fetching a keystroke. The same framework can be used to make calls to the PET’s basout (aka chrout - $FFD2) sub to write to the screen. You could also add code to deal with PETSCII. With a little more effort, you could make this into an all-purpose kernel sub caller.
... extensive code snippet cut ...
Now, I haven’t tested the above code—no souped-up PET, but I see no reason for it not to work. You may have to fiddle with it to accommodate the way your PET’s hardware is interacting with the MPU.
Many thanks for that elaboration! I arrived at a smaller version as I used some of the options you mention - like not modifying the stack pointer, or even not saving all registers as the code I call does not use them... (ah that reminds me - emulation mode clears the upper byte in X/Y as well? I should probably push them too... (referring to above of *****)
Is there a documentation, what is actually expected from these two calls regarding the M and X mode bits?
I attached the Supermon 816 manual, which is the most complete documentation of the software. It is included in
the distribution that is on my website.
supermon816.pdf
Thanks for the good documentation. What I am still fighting with though is, which internal routine is called with which M/X bits set as it seems I may have missed some hints during conversion to xa, and will probably have to insert some mode
pseudo-opcodes... That's where my convention of adding required modes to a lable comes from - make the required mode flags explicit to avoid ambiguities...
Having said that, I will probably have to reverse the control flow anyway - currently the monce routine loops, reads chars into a buffer, and executes them and returns to the loop. My goal is to use the monitor in these settings:
1. when called from BASIC with SYS in the normal BASIC editor
2. when called from a special key shortcut, in a separate screen so you can interrupt running code and look at it
3. when configured from boot, from a serial line interface, running in the interrupt
So, the plan is to extract the monce loop, potentially triple the input routine for the different setups (that should of course be able to run in parallel - you may have noticed sometimes I'm looking for a challenge

), and then just call the command interpreter / executor from the outside, with interrupt flag set.
Related to that I think I would add (optional) "MX" fields in the assembly/disassembly input and output, to replace the internal state that (I think) is held for the disassembly to correctly interpret the binary code for immediate values.
This would also facilitate "scroll disassembly": move the cursor down to the bottom of the screen and scroll up, and the disassembly (or memory dump for that matter) continues. You may know this behaviour from machine language monitors on the C64, where it even works upward, but that is without mode bits.... (re: ******) ....
Also, the 4k limit has fallen - I will move the assembler to a different bank if needed.
So, a lot to do...
Thanks for your support!
André