• Please review our updated Terms and Rules here

tmon: The Tolerable Monitor

cjs

Veteran Member
Joined
Nov 5, 2021
Messages
1,518
Location
Tokyo, Japan
I've long found the built-in machine-language monitors in my vintage computers frustrating, when they even have a monitor at all, and I've finally sat down to do something about this. So I've designed a new monitor, called "tmon," that I feel will be a more powerful and convenient to use yet still be fairly compact, suitable for dropping into a ROM in computers that have space for this (e.g., into the option ROM socket on a NEC PC-8001, or loading into the Language Card on an Apple II). Currently I have only an 8080 version, but I do intend to write 6800 and 6502 versions as well, and perhaps even 6809, 68000 and 8086 versions.

The goals of this project, as described in the README, are to have:
  • Reasonably small code size: under 2 KB.
  • Very minimal RAM usage: just 2-3 dozen bytes so it can run on e.g. a 6802 with only its 128 bytes of internal RAM.
  • Significantly better features than many home computers' built-in monitors, including properly handling the usercode stack (or working without a valid usercode stack).
  • A user interface focused on convenience. For example, remembering recently used addresses so you need not continually re-type them and allowing you to intersperse hex and ASCII data input.
  • Efficient use of the display, allowing you to display just what you need and minimise non-informational printing to reduce useful information scrolling off the screen.
What I've got now seems good enough to be usable, so I'm now looking for feedback, whether it's just comments on the README or from actual use. Towards this end I've consed up a CP/M version that, while not yet a substitute for DDT (because it runs in the TPA, rather than relocating itself above it), does let you play with it and get a good feel for how it works. I'm particularly looking for feedback on the design of the monitor, but I also welcome comments on the code, especially since this is my first major project in 8080/Z80 assembly language.

If you want to do me the favour of trying it out, attached is a ZIP file with the full README and TMONLVT.COM, which should run on any CP/M system. The ASCII display requires a VT100-compatible terminal supporting reverse and underline character attributes, but aside from that it will work fine on any output device that handles backspace, CR and LF in the expected way. There seem to be some bugs (do read the platform release notes at the end of the README); in particular the K "call" command works on my command-line CPU simulator but not on CP/M for some reason. The README describes where to find the source. (If you want to build from source and experiment with changing it, I'm happy to provide support for that, or even pair-program with you to get you started.)

I'm also happy to look at building machine-specific versions for whatever machine you'd like to use it on. As you can see in the TODO list, Kyocera-85 machines (NEC PC-8201, TRS-80 Model 100, etc.) are high on my list for ports in the near future, as is PC-8001, but I'm happy to look at anything else.
 

Attachments

After some experimentation, it's clear that having only VT100 support in the CP/M version was pretty annoying when you're not on a CP/M machine, particularly because it was often printing out unnecessary "turn attributes off" codes during user input.

So I've fixed that (it only prints an attributes-off code if there's been a recent attribute-on code) and also made the attribute control strings configurable at runtime. In the attached new version you can now change the control strings by patching locations $103 (attributes off), $10A (control char attribute) and $111 (high-bit-set char attribute) to have a length byte followed by up to six bytes to send to the terminal as the control string.

I'll probably cons up an "overlay" .HEX file for Commodore 128 CP/M in the next couple of days so that you can easily use DDT to permanently patch a copy of TMONLO.COM for that terminal. If anybody wants overlays for other terminals, just let me know what codes you want.
 

Attachments

I've now ported tmon to the TRS-80 Model 100 and 102, in a very basic way. It runs as a standard .CO program, starting at location 61000, which means it's not so useful for debugging other .CO programs, but it's still nice for debugging BASIC programs or just poking around the system. As is typical, you'll need to CLEAR 256,61000 before you can run it.

This has been tested only on VirtualT M100 and M102 emulation; it broke in other emulations but I'm not sure if that's a problem with VirtualT (which doesn't claim to emulate anything other than Model 100) or my software. I'll be testing it on several different models of real machines soon enough.
 

Attachments

Back
Top