I found what looked like a neat little minification utility on page 92 of "The Model 100 Companion"[1], 1984 Osborne/McGraw-Hill. I took the OCR copy of the book from Internet Archive[2], fixed many many OCR errors, and ran the utility on itself. I made a modest enhancement to support writing the output to TPDD, but it seems flaky. Reading from TPDD is simple, just use 0: notation as you would expect, and writing to RAM worked great.
The utility, called "Compress" in the book, applies the usual BASIC
minification tricks to combine lines, remove comments, and eliminate excess
spaces from an ASCII BASIC listing, producing a smaller ASCII BASIC listing
as output.
I have attached a ZIP file of the program, containing three files:
COMPR.DO -- My modified version of the original program
MINIFY.DO -- The squished version of the above program
MINIFY.BA -- A tokenized file of the minified version, ready to run.
My apologies for the binary attachment. The S3 bucket I usually use to
host files for the public was inadvertently deleted a couple of months
back, and I haven't had a chance to restore it.
The program was tested and the transcription debugged directly on my M102,
although I did the bulk of the cleanup work on a more modern computer. I
tried to use VirtualT to test, but unfortunately the Mac version I have
seems to have a keyboard bug, and I can't type quotes or a couple of other
characters -- making it hard to load things from the NADSbox emulator.
I do not have other hardware with which to test.
The most difficult part of the OCR cleanup process was both finding all the
places the "i1" variable was changed to something incorrect ("ii" and "11"
were common OCR errors), and finding the couple of places where a non-ASCII
quote mark was used, causing the load from .DO to corrupt memory and cause
cold resets.
[1] The original book, turned to the page in question:
https://archive.org/details/TheModel100Companion/page/n93/mode/2up
[2] The OCR version of the book, which saved a great deal of typing but not
that much time:
https://archive.org/stream/TheModel100Companion/the%20model%20100%20companion_djvu.txt
<<attachment: MINIFY.ZIP>>
