--- title: "BOLD" id: 54521 type: "computer_media" slug: "bold" url: "http://localhost/computer_media/bold/" markdown_url: "http://localhost/computer_media/bold.md" published_at: "2024-06-02T16:22:43+00:00" modified_at: "2026-03-30T21:29:15+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "A tiny machine code patch toggles bold, heavy-weight character output on and off with a single POKE to a system address." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Font" slug: "font" taxonomy: "genre" url: "http://localhost/type/font/" media_contents: - id: 51213 title: "CATS Library Tape 3" type: "computer_media" url: "http://localhost/computer_media/cats-library-tape-3/" - id: 64711 title: "Long Island Sinclair Timex (LIST) User Group Library Tape #2.2" type: "computer_media" url: "http://localhost/computer_media/long-island-sinclair-timex-list-user-group-library-tape-2-2/" media_type: "Program" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/06/Bold.png" media_type_tags: "Font" --- # BOLD This program loads and activates a machine code routine that replaces the normal character output with a bold (heavy) print style on a Sinclair computer. The machine code is stored starting at address 57786 and is invoked via RANDOMIZE USR 57786, a common technique for executing arbitrary machine code from BASIC. The bold effect is toggled by poking address 23607 with either 220 (bold) or 60 (normal), which modifies the system font or print routine behavior. The program saves itself as a BASIC file with an auto-run LINE 20 parameter, and also saves the machine code block (29 bytes starting at 57786) as a separate CODE file named “bold.” *** ## Program Analysis ### Program Structure The program is a loader and installer for a small machine code routine. It follows a straightforward sequence: reserve memory, load the code, activate it, display instructions, then save everything back to tape. 1. `LINE 10` — REM label identifying the program’s purpose. 2. `LINE 20` — `CLEAR 56575` reserves protected memory above 56575, ensuring the machine code area at 57786 is not overwritten by BASIC. 3. `LINE 30` — Loads the CODE block from tape and immediately executes it via `RANDOMIZE USR 57786`. 4. `LINEs 35–39` — Print usage instructions to the screen. 5. `LINE 40` — `LIST` displays the current program in the new bold font as a demonstration, then `STOP` halts execution. 6. `LINE 50` — Saves the BASIC program (auto-run from line 20) and the 29-byte machine code block back to tape. ### Machine Code Usage The machine code routine is 29 bytes long, residing at address 57786. It is invoked with `RANDOMIZE USR 57786`, which calls the routine as a subroutine and discards the return value — a standard idiom for running machine code from BASIC without a separate `POKE`/`CALL` mechanism. The routine patches the system to redirect or modify character output so that each character is rendered in a bold style. ### Toggle Mechanism via POKE 23607 Address 23607 is a system variable (P-RAMT area or a vector byte used by the ROM print routines). The program documents two values for this address: | Value | Effect | | --- | --- | | `220` | Bold (heavy) character output active | | `60` | Normal character output restored | This suggests the machine code installs a patch that reads this byte at print time to decide whether to apply the bold rendering, making the effect reversible without reloading anything. ### Memory Layout The `CLEAR 56575` command sets RAMTOP just below the machine code’s load address of 57786, protecting the routine from being overwritten by BASIC’s heap. The gap between 56575 and 57786 is 1210 bytes, which is likely intentional padding or alignment. ### Save Strategy `LINE 50` performs two saves in sequence. First, `SAVE "bold" LINE 20` saves the BASIC program with an auto-run parameter so it restarts from `LINE 20` on load. Second, `SAVE "bold"CODE 57786,29` saves exactly 29 bytes of machine code starting at address 57786. When the tape is later loaded, the user must load both the BASIC file and the CODE file (in that order, since `LINE 30` issues `LOAD ""CODE` automatically). ### Notable Techniques - Combining `LOAD ""CODE` and `RANDOMIZE USR` on a single line (`LINE 30`) using the colon separator allows the machine code to be loaded and immediately executed in one step. - Using `LIST` on `LINE 40` as a live demonstration of the bold font is an elegant self-referential test — the program listing itself becomes the sample output. - The 29-byte footprint of the machine code is notably compact, consistent with a minimal ROM-patching or character-redraw routine. ### Potential Anomalies The `CLEAR 56575` value and the machine code address 57786 do not leave the code immediately above RAMTOP; the 1210-byte gap is unusual and may indicate the routine was originally developed for a specific memory configuration or that some of the intervening addresses are used for data by the routine. No bugs are apparent in the BASIC itself. ## Source Code ``` 10 REM bold print 20 CLEAR 56575 30 LOAD ""CODE : 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,29 ```