This program loads and saves a machine code routine called “RAMDIZK” stored at memory address 52836 and occupying 1014 bytes. The two-part save structure separates the BASIC loader stub (line 40) from the machine code block (line 41), a common distribution technique for hybrid BASIC/machine code software. The machine code is invoked via RANDOMIZE USR 53300, as noted in the REM at line 20, jumping execution into the loaded routine. Line 11 loads the code block back into its fixed address before the STOP at line 30 halts the BASIC loader.
Program Analysis
Program Structure
The listing is a hybrid BASIC/machine code distribution stub. It serves two purposes: restoring the software from tape (lines 11–30) and creating a fresh tape copy (lines 40–41). The BASIC itself does almost no work beyond orchestrating the load and save of the accompanying machine code block.
- Line 10 — REM banner identifying the program as “RAMDIZK”.
- Line 11 —
LOAD "RAMDIZK" CODEloads the machine code block back to its original address (52836). - Line 20 — REM documents the activation command:
RANDOMIZE USR 53300. - Line 30 —
STOPhalts the BASIC loader after the code is loaded, returning control to the user. - Line 40 —
SAVE "RAMDIZK"saves this BASIC loader program. - Line 41 —
SAVE "RAMDIZK" CODE 52836,1014saves the 1014-byte machine code block from address 52836.
Machine Code Block
The machine code occupies 1014 bytes starting at address 52836. The entry point documented in the REM is 53300, which is 464 bytes into the block — suggesting the routine has internal structure, possibly with data tables or sub-routines before the main entry point.
| Parameter | Value |
|---|---|
| Load/save address | 52836 |
| Block length | 1014 bytes |
| Entry point | 53300 (offset +464) |
| Activation | RANDOMIZE USR 53300 |
Address 52836 places the code in the upper RAM area, typically used for machine code utilities to avoid interference with BASIC and its variables. A 1014-byte routine is substantial enough to implement a full RAM disk driver, including sector management and file I/O hooks.
Notable Techniques
- Two-file tape format: Saving the BASIC loader and the machine code as separate named files (both called “RAMDIZK”) on the same tape is a standard distribution convention; the loader auto-chains the code load on playback.
- REM as documentation: Line 20 embeds the usage instruction directly in the listing as a REM, so users can read it with
LISTwithout needing a separate manual. - STOP after load: Using
STOPrather thanPAUSEor an infinite loop gives the user a clean prompt and a “0 OK” report after loading, signaling readiness without leaving the program running. - Fixed high-memory address: Targeting address 52836 keeps the routine at a predictable location, which is required since the entry point (53300) is hard-coded into the activation command.
Anomalies and Observations
The program listing contains no code to actually invoke RANDOMIZE USR 53300 itself; the user must type this manually after the loader finishes. This is intentional — it allows the RAM disk to be installed without immediately activating it, giving the user a chance to verify the load before committing.
Content
Source Code
10 REM RAMDIZK
11 LOAD "RAMDIZK"CODE
20 REM TO USE"RANDOMIZE USR 53300"
30 STOP
40 SAVE "RAMDIZK"
41 SAVE "RAMDIZK"CODE 52836,1014
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
