Locking Up

Author(s): Thomas Bullock
Publication: Timex Sinclair User
Pub Details: Timex Sinclair User n5 (Volume 1, Issue 5)
Date: October 1983
Pages: 52
Computer and monitor wrapped in barbed wire
Computer and monitor wrapped in barbed wire

How to prevent nosey people from LOADing your programs?

On your 16K machine, type in:

POKE 16388,255
POKE 16389,127
NEW
POKE 32767,n

This sets RAMTOP down 1 byte; the secret code number “n” may be any integer in the range 1 to 255 except 62.

Now type in or load the program to be protected and add the following lines:

9960 STOP
9970 SAVE "program name"
9980 IF PEEK 32767 <> n THEN
RAND USR 0
9990 GOTO start

To save, type GOTO 9970.

To load, do step 1 and load normally. If your code number n is at 32767 the program will run automatically; otherwise it will vanish without a trace because USR 0 has the same effect as pulling out the power supply. Don’t forget your code number!

Values for other memory sizes:

              1K      2K      16K
POKE 16388    255     255     255
POKE 16389    67      71      127
Code Addr.    17407   18431   32767

RAMTOP may, of course, be set to any lower value.

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