June 1983 Loader

This file is part of and Synchro-Sette June 1983. Download the collection to get this file.
Date: June 1983
Type: Program
Platform(s): TS 1000

This is a cassette tape menu loader program that presents a styled selection screen listing eight programs available on the tape. It uses machine code via RAND USR 16514 to perform initialisation, and POKEs address 16418 to zero (clearing the system variable that controls cursor/display state). The menu displays program titles in inverse video using ZX81 block-graphic and inverse-character escapes, with numbered shortcuts (1–8) that route to the appropriate LOAD statement via the computed GO TO at line 90 (100*VAL A$). Input validation at line 50 checks that the keycode falls between 28 and 37, corresponding to digit keys 1 through 9 on the ZX81 keyboard.


Program Analysis

Program Structure

The program is organised into three clear phases: initialisation (lines 1–4), display (lines 5–14), and input/dispatch (lines 20–900). Lines 9998–9999 form a self-save tail that preserves the loader itself to tape and re-runs it, typical of ZX81 tape utilities distributed on compilation cassettes.

  1. Lines 1–4: Machine code call, system variable patch, and initial display setup.
  2. Lines 5–13: Full menu screen rendered with inverse video titles and digit shortcuts.
  3. Line 14: Switches to SLOW mode for display stability during input polling.
  4. Lines 20–50: Polling loop with a flashing prompt; validates the keypress.
  5. Lines 60–90: Clears the screen and dispatches via computed GO TO.
  6. Lines 100–800: Individual LOAD statements, one per menu entry.
  7. Line 900: LOAD "" — loads the next file blindly; never normally reached via menu.

Machine Code Usage

Line 3 executes RAND USR 16514. Address 16514 (0x4082) lies in the ZX81 ROM and is used here to invoke a ROM routine for display or system initialisation. Line 4 uses POKE 16418,0; address 16418 (CDFLAG / FRAMES system variable area) is set to zero, which on the ZX81 resets the frame counter or disables cursor blink state, ensuring a clean display before the menu is painted.

Key BASIC Idioms

  • GOTO 100*VAL A$ (line 90): A classic computed GO TO. The digit character pressed is converted to its numeric value (1–8) by VAL A$, multiplied by 100, and used as the branch target. This dispatches to lines 100, 200, … 800 with a single statement.
  • Input validation at line 50 checks CODE A$<28 OR CODE A$>37. On the ZX81, digit characters ‘1’–’9′ have character codes 28–36, so this correctly rejects non-digit and out-of-range keys before the computed GO TO is reached.
  • Lines 30–40 implement a busy-wait polling loop: LET A$=INKEY$ followed by IF A$="" THEN GOTO 20, redirecting through the prompt reprint at line 20, creating a blinking effect between the block-graphic border and the inverse-video text.
  • FAST/SLOW switching (lines 2, 14, 60, 80) is used carefully: FAST during initial drawing, SLOW during input so the display is maintained, then FAST again for the CLS before loading.

Display Techniques

Line 5 prints a full-width row of inverse-space characters (\@@ × 64) at row 22 to create a highlighted status bar, then overlays a title block using ZX81 block graphics (\: … \ : = left and right vertical bar characters) to produce a boxed heading. Lines 6–13 use inverse-video character sequences (e.g. %B%A%N%K%) to render each menu title in inverse text, with TAB 28 to right-align the digit shortcut in inverse.

Line 20 combines two AT clauses in a single PRINT: first printing a block-graphic bordered prompt, then reprinting the same position with an inverse-video version, achieving an alternating flash effect each time the loop passes through line 20.

Menu Dispatch Table

KeyTarget LineProgram Loaded
1100BANK SHOT
2200DEPOSIT MULTIPLIER
3300MATH-HELPER
4400NUMBER MASTER
5500GRAN MARQUEE
6600TAPE FILE
7700SUB-NINER
8800BULLETIN

Notable Anomalies

  • The LOAD filenames (lines 100–800) mix inverse-video sequences (e.g. %B%A%N%K% %S%H%O%T) with plain text. On the ZX81, the LOAD filename must match exactly what was saved; if the programs were originally saved with inverse characters in their names, these LOADs are correct. If not, they would fail silently and wait for any tape block.
  • Line 900 (LOAD "") is never reachable via the menu (key ‘9’ would dispatch to line 900, but code 37 = ‘9’ passes validation and multiplies to 900). This is either an intentional escape or a residual catch-all for an unlisted ninth program.
  • Lines 9998–9999 (SAVE "LOAD6/8%3" followed by RUN) allow the loader itself to be re-saved to tape; the RUN at 9999 ensures that after saving, the menu restarts automatically.

Content

Appears On

Cassette to accompany the June 1983 issue of Synchro-Sette.

Related Products

Related Articles

Related Content

Image Gallery

June 1983 Loader

Source Code

a   1 REM Y\@@\.'\. :%KNOT $TAB \@@RND\: TAB \'.RNDTAN 
   2 FAST 
   3 RAND USR 16514
   4 POKE 16418,0
   5 PRINT AT 22,0;"\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@\@@";AT 2,3;"\: JULY 1983 LOADER PROGRAM\ :"
   6 PRINT AT 5,1;" %B%A%N%K% %S%H%O%T ";TAB 28;"%-% %1"
   7 PRINT AT 7,1;" DEPOSIT MULTIPLIE%R ";TAB 28;"%-% %2"
   8 PRINT AT 9,1;" MATH-HELPE%R ";TAB 28;"%-% %3"
   9 PRINT AT 11,1;" NUMBER MASTE%R ";TAB 28;"%-% %4"
  10 PRINT AT 13,1;" GRAN MARQUE%E ";TAB 28;"%-% %5"
  11 PRINT AT 15,1;" TAPE FIL%E ";TAB 28;"%-% %6"
  12 PRINT AT 17,1;" SUB-NINE%R ";TAB 28;"%-% %7"
  13 PRINT AT 19,1;" BULLETI%N ";TAB 28;"%-% %8"
  14 SLOW 
  20 PRINT AT 22,6;"\: ENTER ONE OF ABOVE\ :";AT 22,6;"% %E%N%T%E%R% %O%N%E% %O%F% %A%B%O%V%E% "
  30 LET A$=INKEY$
  40 IF A$="" THEN GOTO 20
  50 IF CODE A$<28 OR CODE A$>37 THEN GOTO 20
  60 FAST 
  70 CLS 
  80 SLOW 
  90 GOTO 100*VAL A$
 100 LOAD "%B%A%N%K% %S%H%O%T"
 200 LOAD "DEPOSIT MULTIPLIE%R"
 300 LOAD "MATH-HELPE%R"
 400 LOAD "NUMBER MASTE%R"
 500 LOAD "GRAN MARQUE%E"
 600 LOAD "TAPE FIL%E"
 700 LOAD "SUB-NINE%R"
 800 LOAD "BULLETI%N"
 900 LOAD ""
\n9998 SAVE "LOAD6/8%3"
\n9999 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top