This program will choose random number selections. You can define how many numbers in a selection and between what numbers: first the top of the range (15 to 99), then how many numbers make up each selection (1 to 10), and the program prints 15 selections at a time. The menu also turns printer output on and off and chooses between the TS2040 printer and a full-size printer. The instructions say to load your printer driver at 40000 before loading Lotto, and never to choose the TS2040 option with a full-size printer, because that option uses COPY.
Lotto was written by Kristian Boisvert and published on the February 1988 tape (Issue 9) of Byte Power, listed as a personal utility. The magazine adds a joking warning that Byte Power is not liable for money lost gambling on its selections.
Program Analysis
Tape Layout
LOTTO: BASIC loader, 472 bytes, auto-runs at line 0SCREEN: 2,619 bytes of code at 62402, the program, started withUSR 62402
The Loader
The BASIC part is a protected loader. Every number you see in it (99999, 999, 9) is a decoy: the real values are held in the hidden five-byte number forms that follow each one. The length bytes of line 0 are set to 65535, so the listing stops at line 0, and line 0 first POKEs them back to their true value (addresses 26712–26713, just after the start of the TS2068 program area) and jumps to line 10. Line 90, RANDOMIZE USR (PEEK 23635+256*PEEK 23636+61), runs machine code stored inside the REM of line 0.
Line 10 sets colours and CLEAR 27999, and POKEs 0 into DF SZ (23659), which removes the lower screen so that BREAK or an error report cannot return cleanly to BASIC. Line 30 loads the single code block, resets the character set pointer (POKE 23607,60), sets DF SZ to 2 again and starts the program at 62402. No readable text survives in the code blocks, which appear to be encrypted or compressed, so the machine code is not described here.
Line 9999 is the publisher’s save line: it calls a routine at 65280, sets the length of line 0 back to 65535 and saves "LOTTO" LINE 0.
Notable Techniques
- Decoy line numbers and values in the loader: the visible digits differ from the stored binary values, so the listing cannot be read at face value
- Line 0 has a false length of 65535, so
LISTshows only that line; the program repairs it when it runs - The program code is loaded high, at 62402, leaving 40000 free for a printer driver
- The code block is named
SCREENalthough it holds the program
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

