Program Header Listing

See all articles from T-S Horizons n10

If you are like me, you like to have backup copies of your T/S programs to use on a regular basis. I put the master copies of my tapes away so that they don’t get damaged.

Some programs are easy to backup. If they are completely in BASIC, you simply break the program, and look through the listing to see where they Autorun from. Many times the SAVE routine is imbedded right into the program. Then all you have to do is prepare your recorder and type GOTO XXX (the line number of the SAVE routine).

Other times, the program is loaded in several parts. Usually the order is:

1) Loader Program – in BASIC
2) Cover Screen – Saved as SCREEN$
3) Main body of program – in BASIC or Mach Code

These too can be saved if you know the procedure. Start by typing MERGE “”, and load the tape. When you get the condition code in the lower left screen, stop the tape and LIST. You will then see the Loader listing and may be able to figure out how to save the rest of the program from there.

However, many programmers use techniques to “mask” the vital information you may need to save a program properly. Like what line is the Autorun line in a BASIC program? Or what is the Starting Address and Data Length for a Machine Code section?

Well, with the “Header” program listing enclosed, you can back up almost ANY TS2068 program you have. By law, you are permitted to make backup for your personal use. (Selling them is another story!!!)

Of all of the programs I have, only one would not work with “Header”. And it was from England, so I guess there might be a program floating around somewhere to do the same for Spectrum software…

After typing the “Header” listing in, save it to tape with:

SAVE "header" LINE 9970

Make several copies on one tape, as it is very short. (How about making a second copy to put away with your Master tapes?!?)

Here is the procedure to using “Header”:

1) LOAD “header” into the computer. When it finishes loading, stop the tape.
2) Place the program tape you want to examine into the recorder and press PLAY.
3) As soon as the header on the program tape is read, the program will tell you the information you need:
A) If the section is in BASIC, it will give you the Title, the Data Length, and the Auto Start Line.
B) If the section is in MACHINE CODE, the program will give you the Data Length and the Starting Address. If the Data Length = 6912 and the Starting Address = 16384, this section is a SCREEN$.
4) Make sure you write the information down as soon as it appears on the screen.
5) After making note of the information, press any key and press PLAY to read the next section. The same info you just wrote down will appear again, so press any key when it appears again to clear the screen. Repeat Steps 2-4 for the entire program.
6) After collecting the information from the entire program, rewind the tape and reset the machine. Using the information you have, proceed to make a backup copy of the program.

Remember when saving a MACHINE CODE section, use the command:

SAVE "name" CODE aaaa, bbbb

aaaa: the Starting Address
bbbb: the Data Length

(This program is provided courtesy of the T/S Users Group in Memphis, Tennessee. “Header” is a public-domain program, so feel free to make copies for your friends.)

9970>CLEAR 63999: FOR a=64000 TO 64052: READ b: POKE a,b: NEXT a
9971 CLEAR 63999: FOR a=64000 TO 64052: READ b: POKE a,b: NEXT a
9975 CLS : PRINT ''''" Load a tape and press PLAY"''''
9980 DATA 55,62,0,221,33,60,250,17,17,0,205,14,250,201,33,252,0,205,34,250,58,33,250,211,244,219,255
9981 DATA 203,191,211,255,251,201,0,243,245,219,255,203,255,211,255,219,244,50,33,250,62,1,211,244,241,233
9982 RANDOMIZE USR 64000
9983 LET a=64060: LET b=PEEK a: LET s=b
9984 IF b=0 THEN PRINT "PROGRAM: ";
9985 IF b=1 THEN PRINT "NUMERIC ARRAY: ";
9986 IF b=2 THEN PRINT "CHARACTER ARRAY: ";
9987 IF b=3 THEN PRINT "BYTES: ";
9988 FOR a=64061 TO 64070: LET b=PEEK a: PRINT CHR$ b;: NEXT a: PRINT
9989 LET b=PEEK a+256*PEEK (a+1): PRINT "DATA LENGTH: ";b
9990 LET a=a+2: LET b=PEEK a+256*PEEK (a+1): IF s=3 THEN PRINT "START ADDRESS: ";b
9991 IF s<>0 THEN GO TO 9995
9992 IF b<1 OR b>9999 THEN GO TO 9994
9993 PRINT "AUTO START AT: ";b
9994 LET a=a+2: LET b=PEEK a+256*PEEK (a+1): PRINT "PROG/VARS LENGTH: ";b
9995 PRINT ''''"For another tape, touch ANY KEY"
9996 PAUSE 0: GO TO 9975

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