RENUM – A ZX81 or TS1000 Utility

See all articles from ZX-Appeal Sept 87
Author(s): Geoffrey Byrne
Publication: ZX-Appeal
Pub Details: ZX-Appeal Sept 87
Date: September 1987
Pages: 11-12

I have discovered something I have not read about elsewhere. The Sinclair manual says that the highest line number allowable is 9999. Although this is so, in practice line numbers higher than this may be utilized using the Renumber Routine which follows.

An advantage of this is that the lines pushed over the 10000 limit cannot be re-edited and are therefore safe from tampering. This could be useful in preserving data held in strings, etc.

Enter the following program:

  10 REM XXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX
20 REM ***LOADER***
30 FOR J=16516 TO 16560
40 INPUT N
50 PRINT AT 18,8;J,N
60 SCROLL
70 POKE J,N
80 NEXT J

Run the program and enter the following data checking carefully as you go:

33,125,64,17,0,0,126,230,192,192,229,70,35,78,35,235,229,237,
66,225,56,18,193,124,2,3,125,2,1,10,0,9,235,78,35,70,35,9,24,
222,96,105,193,24,239

Now enter as direct commands:

POKE 16514,0
POKE 16515,0
SAVE "RENUMBER"

Having SAVEd the program, enter RUN and then the following:

9990 REM
9991 FOR J=1 TO 15
9992 PRINT "ANYTHING YOU LIKE"
9993 NEXT J

Check this by entering:

SLOW
RUN 9990

Now enter RAND USR 16516 and LIST. You should now find some very odd looking line numbers in the listing. The listing should be as follows:

A000 REM
A010 FOR J=1 TO 15
A020 PRINT "ANYTHING YOU LIKE"
A030 NEXT J

As you can see, the ’10’ of 10,000 has been replaced by ‘A’ as in Hexidecimal, but the other numbers remain in the decimal! Since the first character of the line number is not recognized by the ZX81 as a number, it cannot be accessed for editoring, and is therefore incorruptable once placed over 10000.

These lines ca be accessed from within a program. Enter the following:

100 LET A=10010
110 CLS
120 GOTO A
RUN 100 or GOTO 100

As can be seen from these examples, the ZX81 equates 10010 with A010. Using REM statements to pad out the numbers of the lines under 10000 is the only way to push a routine over the magic limit, using the RENUMBER routine. I hope some people will find a genuine use for these safe lines.

Reprinted from the Data Expansion – the newsletter of the Fort Worth T/S Users Group.

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