Bold Print is a machine code utility for the TS2068 that replaces the system font with a heavier, bolder character set to improve readability in printed listings. The machine code block of 29 bytes is loaded at address 57786 and executed with RANDOMIZE USR 57786, which patches the system to redirect character rendering. The bold font is activated by POKEing 23607 with the value 220, and the standard font is restored by POKEing 23607 with 60. The program saves both the BASIC loader and the machine code binary, making it a self-contained installation utility.
Program Structure
The program is a short self-installing loader with two functional phases: installation and persistence. Lines 20–40 handle loading and activating the machine code patch, while line 50 saves both the BASIC loader (with LINE 20 for auto-run) and the machine code binary back to tape.
| Line(s) | Purpose |
|---|---|
| 10 | REM label — program title only |
| 20 | CLEAR to protect machine code area below 56575 |
| 25 | Load 29 bytes of machine code to address 57786 |
| 30 | Execute machine code via RANDOMIZE USR 57786 |
| 35–39 | User instructions displayed on screen |
| 40 | LIST the program then STOP |
| 50 | Save BASIC loader and machine code binary to tape |
Machine Code Usage
The machine code block is only 29 bytes, loaded at address 57786 and invoked with RANDOMIZE USR 57786. Its purpose is to patch the system variable at address 23607 (the high byte of the CHARS system variable pointer), redirecting the ROM’s character lookup to a custom bold font held elsewhere in memory. The CLEAR 56575 at line 20 ensures the BASIC memory map does not encroach on the machine code’s residence at 57786.
Font Toggle Mechanism
Address 23607 is the high byte of the CHARS system variable (a two-byte pointer at 23606–23607), which the ROM uses to locate the character set. By POKEing 23607 with 220, the pointer is redirected to the bold font data. Restoring it to 60 (the default value, pointing 256 bytes before the ROM font at 15616) returns the system to its standard character set. This is a well-known and non-destructive patching technique requiring no ROM modification.
Key BASIC Idioms
CLEAR 56575— sets RAMTOP to protect the machine code block from being overwritten by BASIC.RANDOMIZE USR 57786— standard idiom for calling a machine code routine from BASIC; the return value is discarded.SAVE "bold" LINE 20— saves the BASIC program with an auto-run entry point at line 20, so the loader executes automatically on loading.SAVE "bold"CODE 57786,29— saves the 29-byte machine code block as a separate CODE file at the exact address it was loaded from, making re-installation straightforward.LIST :STOPon line 40 — causes the program to display itself after installation, giving the user an on-screen reminder of the POKE values, then halts.
Notable Techniques
The use of LINE 20 rather than LINE 0 skips the REM statement on line 10, ensuring execution begins immediately at the CLEAR statement. Placing the machine code above the normal BASIC area (at address 57786, near the top of the standard 48K memory map) is a common strategy for small resident patches, keeping them safe from both BASIC and most application programs.
Anomalies and Notes
The CLEAR 56575 sets RAMTOP well below the machine code at 57786, which is the intended behavior — but the code itself must have been loaded into memory before CLEAR could protect it. In practice, this means the user must load the machine code (line 25) after the CLEAR, which is correctly sequenced here. No bugs are apparent in the loader logic.
Source Code
10 REM bold print
20 CLEAR 56575
25 LOAD "bold"CODE 57786,29
30 RANDOMIZE USR 57786
35 PRINT "Bold print now loaded"
37 PRINT "Please use this program for all listings you send to LIST"
38 PRINT "To return to regular printing, just POKE 23607,60"
39 PRINT "To get these heavy characters, Poke 23607,220"
40 LIST :STOP
50 SAVE "bold" LINE 20:SAVE "bold"CODE 57786,29Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.