TRACER

Date: 198x
Type: Program
Platform(s): TS 2068

A machine-code routine that places a small window in the upper left corner of the screen that displays what line and command of a BASIC program is currently running! Great for debugging programs.

Appears on

Capital Area Timex Sinclair User Groupโ€™s Library Tape.

Gallery

Source Code

 9799 STOP 
 9800 REM Merge this program to aBASIC program.GOTO 9800 to tracethe BASIC program
 9807 IF PEEK 65350=201 THEN GO TO 9902
 9810 CLEAR 65217
 9812 PRINT "Please wait..."''"Machine Code Loading"
 9815 RESTORE 9825
 9820 FOR q=65218 TO 65352: READ a: POKE q,a: NEXT q
 9823 REM data A:
 9825 DATA 42,80,255,237,91,82,255,167,237,82,0,56,1,201,42,84,255,35,35,35,0,0,62,13,35,190,32,252,35,34,84,255,70,35,78,237,67,80,255,24,215,0,0
 9830 REM data B:
 9835 DATA 42,84,255,35,35,35,35,126,254,250,40,63,254,235,40,59,254,243,40,55,254,237,40,51,254,254,40,47,254,236,40,43,254,226,40,39,35,126,254,13,40,10,254,58,40,216,254,34,40,15,24,240
 9840 REM data S13:
 9845 DATA 35,34,84,255,70,35,78,237,67,80,255,24,191
 9850 REM data SEE:
 9855 DATA 1,0,2,35,62,34,237,177,24,218
 9860 REM data OUT:
 9865 DATA 6,0,78,34,86,255,201,0,0,42,84,255,24,203,201,0,0
 9870 CLS 
 9900 REM Flow Utility
 9901 IF PEEK 65350<>201 THEN PRINT "Machine Code not Loaded..."''"GOTO 9800": STOP 
 9902 DIM s(50): LET s=0: LET ll=s
 9905 PRINT "Basic Program Flow:";AT 0,0; OVER 1;"_________ _________"
 9907 INPUT "Starting Line Number? ";l
 9910 IF l>=9800 THEN GO TO 9907
 9912 LET l2=INT (l/256): LET l1=l-l2*256
 9913 POKE 65362,l1: POKE 65363,l2
 9914 POKE 65364,86: POKE 65365,104: POKE 65360,PEEK 26711: POKE 65361,PEEK 26710
 9915 RANDOMIZE USR 65218: LET a=PEEK 65364+256*PEEK 65365: LET l=PEEK (a+1)+256*PEEK a
 9916 LET c=USR 65261
 9917 LET l=PEEK 65360+256*PEEK 65361: IF l>=9800 THEN PRINT "END of BASIC": STOP 
 9918 LET a=PEEK 65366+256*PEEK 65367
 9919 IF c=250 THEN GO TO 9950
 9921 IF l=ll THEN PRINT ": ";
 9922 IF l<>ll THEN PRINT : PRINT l;" ";: LET ll=l
 9923 IF c=254 THEN PRINT "RETURN";: LET l=s(s): LET s=s-1: GO TO 9912
 9925 IF c=235 OR c=243 THEN PRINT CHR$ c;: GO TO 9980
 9927 IF c=226 THEN PRINT "STOP": STOP 
 9930 LET a=a+1: LET g=PEEK a
 9933 IF g<>14 THEN GO TO 9930
 9935 LET a=a+3: LET g=PEEK a+256*PEEK (a+1)
 9937 IF c=237 THEN PRINT "GOSUB ";: LET l=l+1: LET s=s+1: LET s(s)=l
 9940 IF c=236 THEN PRINT "GOTO ";
 9945 PRINT g;: LET l=g: GO TO 9912
 9950 LET a=a+1: IF PEEK a<>203 THEN GO TO 9950
 9952 LET c=PEEK (a+1)
 9954 IF l<>ll THEN PRINT : LET ll=l
 9955 PRINT l;" IF...THEN ";CHR$ c;: IF c=236 OR c=237 THEN GO TO 9960
 9957 LET a=a+1: GO TO 9980
 9960 LET a=a+1: LET g=PEEK a
 9962 IF g<>14 THEN GO TO 9960
 9965 LET a=a+3: LET g=PEEK a+256*PEEK (a+1): PRINT g;: LET a=a+1: GO TO 9980
 9980 LET l2=INT (a/256): LET l1=a-l2*256: POKE 65364,l1: POKE 65365,l2: LET c=USR 65345: GO TO 9917
 9999 SAVE "tracer": LIST 

People

No people associated with this content.

Scroll to Top