Ramdizk

Date: 198x
Type: Program
Platform(s): TS 2068
Tags: Utility

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.

  1. Line 10 — REM banner identifying the program as “RAMDIZK”.
  2. Line 11LOAD "RAMDIZK" CODE loads the machine code block back to its original address (52836).
  3. Line 20 — REM documents the activation command: RANDOMIZE USR 53300.
  4. Line 30STOP halts the BASIC loader after the code is loaded, returning control to the user.
  5. Line 40SAVE "RAMDIZK" saves this BASIC loader program.
  6. Line 41SAVE "RAMDIZK" CODE 52836,1014 saves 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.

ParameterValue
Load/save address52836
Block length1014 bytes
Entry point53300 (offset +464)
ActivationRANDOMIZE 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 LIST without needing a separate manual.
  • STOP after load: Using STOP rather than PAUSE or 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

Appears On

Related Products

Related Articles

Related Content

Image Gallery

Ramdizk

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.

People

No people associated with this content.

Scroll to Top