A Programming Tip Revisited

Authors

Publication

Pub Details

Date

Pages

See all articles from CATS v3 n3

The April issue carried a renumbering program for the TS-1000 (or ZX-81) by Mark Fisher. See page 10 of the issue for his discussion and page 17 for his example. This routine will work for the 2068 if you change line 9000. In Mark’s example, the value of X=16509 (for the TS-1000) is the starting address of the BASIC program in memory. This is explained in the manual on page 128.

For the 2068, the story is slightly different as Mark explained to me. The address where the program begins is found at addresses 23635 and 23636. (The address requires two bytes.) The 2068 defines these locations in Appendix D, “The System Variables”. (On page 263, note the address for PROG.) So you PEEK these addresses to find where the BASIC program beings as is illustrated in the program below.

The bottom line is that Mark’s program is now set up for the 2068. Try it on one of your routines. Use it as a utility and merge it onto the end of any program you write and watch it renumber the program. Thanks Mark, I learned something.

Products

 

Downloadable Media

 

Image Gallery

Source Code

 8000 REM Renumbering program
 8100 REM by Mark Fisher
 8200 REM April 1985
 8300 REM
 8400 REM
 9000 LET X=PEEK 23635+256*PEEK 23636
 9010 LET N=10
 9020 IF PEEK X*256+(PEEK X+1)>=8000 THEN STOP
 9030 POKE X,INT (N/256)
 9040 POKE X+1,N-(PEEK X*256)
 9050 LET X=X+PEEK (X+2)+PEEK (X+3)+4
 9060 LET N=N+1
 9070 GO TO 9020
Scroll to Top