COMPACTOR

Developer(s): Bob Mitchell
Date: 1986
Type: Program
Platform(s): TS 2068
Tags: Utility

A 122-byte machine-code utility that converts every number in a BASIC program into a VAL “…” expression. Each number in a line is stored with a hidden 6-byte binary form; as VAL “digits” it takes less room, so a long program shrinks by three bytes for every number it holds. Bob Mitchell used it to make room for the Larken disk routines in his programs.

RUN the loader to POKE the code to 63100 from DATA, then load or MERGE the program you want to shrink and enter RANDOMIZE USR 63100. The listing also carries Bob’s tips for Larken disk users (REMDOS, disk menus, saving arrays).

Published in Sinc-Link May-June 1986 (Bob’s Notebook: Convert Numbers to VAL$).

Related Articles

Short machine language program to convert numeric values to VAL expressions.

Image Gallery

Source Code

1 REM COMPACTOR
5 REM run and use RANDOMIZE USR 63100
10 FOR i=63100 TO 63221: READ a: POKE i,a: NEXT i
100 DATA 42,83,92,43,237,75,75,92,35,167,237,66,9,200,35,35,78,35,70,229,35,126,254,13,32,3,209,24,231,254
110 DATA 14,32,243,209,213,11,11,11,197,120,18,27,121,18,229,43,126,254,47,40,19,254,46,56,15,254,196,40,4,254
120 DATA 58,48,7,35,35,119,43,43,24,231,35,54,176,35,54,34,225,35,35,54,34,35,84,93,213,35,35,35,229,42
130 DATA 89,92,167,237,82,68,77,225,237,176,42,75,92,43,43,43,34,75,92,42,89,92,43,43,43,34,89,92,225,193,24,155,0,0,0
199 STOP
200 SAVE "COMPACTOR": VERIFY ""

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