Publication: LISTing Newsletter
Pub Details: LISTing Newsletter November 1984
Date: November 1984
Pages: 4
HEADER READER – ADAPTED BY N. PASHTOON
You can use this program to see the “header” information which tells your computer what’s on the tape its about to get.
Just enter this program and RUN. Then take the tape you’d like to analyse and play it into your computer. As soon as the header finishes, VIOLA! a description of the program, or code, will appear on the screen.
There are separate versions of the program for TS 2068’s and Spectrum. Make sure you use the right one.
TS 2068 VERSION
10 REM <PROGRS. HEADER READER>
20 REM © NAP AUG..10,1984
30 CLEAR 32764
40 LET j=32765: LET head=j+15
50 DEF FN g(x)=PEEK x+256*PEEK (x+1)
60 RESTORE
70 FOR n=0 TO 44: READ code
80 POKE (j+N),code: NEXT n
90 DATA 62,0,55,221,33,42,128,17,17,0,243,245,219,255,203,255,211,255,219,244,50,41,128,62,1,211,244,241,205,252,0,58,41,128,211,244,219,255,203,191,211,255,251,201,0
100 CLS
110 POKE head,4
120 PRINT AT 18,8;"start the tape"
130 RANDOMIZE USR j
140 CLS : LET hdtype=PEEK head
150 IF hdtype=4 THEN GO TO 1000
160 LET h$=""
170 FOR n=1 TO 10
180 LET h$=h$+CHR$ PEEK (head+n)
190 NEXT n
200 PRINT "Prog. Name > ";h$: PRINT : PRINT
205 LET a=head
210 LET hdlen=FN g(a+11): LET hdadr=FN g(a+13): LET hdvars=FN g(a+15)
220 LET vars=hdlen-hdvars
230 IF hdtype THEN GO SUB 500: GO TO 1010
300 PRINT "Program is in BASIC": PRINT
310 PRINT "Program area >";hdvars;" bytes": PRINT
320 PRINT "Variables area >";vars;" bytes": PRINT
330 IF hdadr>10000 THEN PRINT "There is no autostart !": GO TO 1010
340 PRINT "Line # for autostart >";hdadr: GO TO 1010
500 LET b$=""
510 IF hdtype=1 THEN LET b$="Number array"
520 IF hdtype=2 THEN LET b$="Character array"
530 PRINT "Program is a ";b$: PRINT
540 IF hdtype=3 THEN PRINT "Binary code ,start adr >";hdadr: PRINT
550 PRINT "Block length is >";hdlen;" bytes"
560 RETURN
1000 PRINT FLASH 1;AT 18,8;"This is not a tape header"
1010 PRINT FLASH 0;AT 19,1;"Are you game for another try ?(y/n)"
1020 PAUSE 0: IF INKEY$="y" THEN [illegible]

SPECTRUM VERSION
10 REM <PROGRS. HEADER READER>
20 REM © NAP AUG..10,1984
30 REM CLEAR 32767
35 CLEAR 27999
40 REM LET j=32768: LET head=j+42
45 LET j=28000: LET head=j+14
50 DEF FN g(x)=PEEK x+256*PEEK (x+1)
60 RESTORE
70 REM FOR n=0 TO 41: READ code
75 FOR n=0 TO 13: READ code
80 POKE (j+n),code: NEXT n
90 REM DATA 221,33,42,128,17,17,0,243,245,219,255,203,255,211,255,219,244,50,41,128,62,1,211,244,241,205,252,0,58,41,128,211,244,219,255,203,191,211,255,251,201,0
95 DATA 55,62,0,221,33,110,109,17,17,0,205,86,5,201
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.