Tracer

Developer(s): Chris Stone
Date: 1985
Type: Program
Platform(s): TS 2068

This utility will display both the line currently being executed and the statement number within the current line.

Appears on

Gallery

Source Code

   10 REM TRACER
   20 REM CHRIS HOWARD STONE
   30 REM 8 BOULTON GROVE, HULL
   40 REM HUMBERSIDE, HU9 3ED
   50 REM 
   60 REM AUGUST 1985
  100 REM PRINT PAGE ONE
  110 BORDER 0: PAPER 0: CLS : GO SUB 9100
  120 INK 7
  130 PRINT AT 5,0;"This little utility  will  provemost useful in  the  developmentand  de-bugging  of  your  BASICprograms."
  140 PRINT ''"This utility will  display  boththe   line    currently    beingexecuted   and   the   statementnumber within the current  line."
  150 PRINT "If that seems  a  bit  confusingthen  consider   the   followingexample  of  a  one-line   BASICprogram."
  160 GO SUB 9000
  170 LET a$=INKEY$: IF a$="" THEN GO TO 170
  200 REM PRINT PAGE TWO
  210 PAPER 0: CLS : GO SUB 9100
  220 INK 7
  230 PRINT AT 4,0;"222 BORDER 1: BORDER 2: BORDER  3: BORDER 4"
  240 PRINT '"The line number is,  of  course,222.  BORDER  1  is  the   firststatement   within   line   222.Similarly,  BORDER  3   is   thethird   statement   within   theline."
  250 PRINT '"TRACER  displays  the  line  andthe  statement  numbers  of  theprogram     currently      beingexecuted. This   information  isdisplayed in  the   extreme  topright of the screen."
  260 GO SUB 9000
  270 LET a$=INKEY$: IF a$="" THEN GO TO 270
  300 REM PRINT PAGE THREE
  310 PAPER 0: CLS : GO SUB 9100
  320 INK 7
  330 PRINT AT 4,0;"TRACER displays its  informationin the following form:"
  340 PRINT AT 7,9;"[ 001:002 ]"
  350 PRINT AT 9,0;"The first  number  displayed  isthe line number currently  beingexecuted and the  second  numberis the  statement  number  whichis currently being executed."
  360 PRINT '"The   next   pages   will   givedetails of how to load  and  useTRACER  in  the  development  ofyour own programs."
  370 GO SUB 9000
  380 LET a$=INKEY$: IF a$="" THEN GO TO 380
  400 REM PRINT PAGE FOUR
  410 PAPER 0: CLS : GO SUB 9100
  420 INK 7
  430 PRINT AT 5,0;"Details  of  how  to  save   themachine code will  appear  anon.Once you have saved the code  itmust be re-loaded  as  follows:"
  440 PRINT '"1.  Enter  the  command   CLEAR     65278"
  450 PRINT '"2.  Type LOAD """" CODE 65279"
  460 PRINT '"Please  note  that  the  machinecode  TRACER  routine  is   mostdefinitely NOT  relocatable  andMUST be loaded at 65279."
  470 GO SUB 9000
  480 LET a$=INKEY$: IF a$="" THEN GO TO 480
  500 REM PRINT PAGE FIVE
  510 PAPER 0: CLS : GO SUB 9100
  520 INK 7
  530 PRINT AT 4,0;"Once  the  code  is  loaded  theTRACER routine can be  activatedat any time by entering"
  540 PRINT AT 8,6;"RANDOMIZE USR 65500"
  550 PRINT "and may be de-activated  at  anytime by entering"
  560 PRINT AT 12,6;"RANDOMIZE USR 65520."
  570 PRINT '"The information can  be  printedin  normal  or  inverse   video.Location  65535  must  be  POKEdwith  either  1  ( for   inversevideo )   or  0  ( for    normalvideo )."
  580 GO SUB 9000
  590 LET a$=INKEY$: IF a$="" THEN GO TO 590
  600 REM PRINT PAGE SIX
  610 PAPER 0: CLS : GO SUB 9100
  620 INK 7
  630 PRINT AT 7,0;"The machine code TRACER  routinemay automatically  be  saved  totape now."
  640 PRINT '"Press"
  650 PRINT ''" R   TO READ THESE INSTRUCTIONS      AGAIN.": PRINT '" S   TO SAVE ""TRACER"" TO TAPE."
  651 PRINT ''" Q   TO QUIT & LOAD NEXT PROGRAM"
  660 LET a$=INKEY$: IF a$="" THEN GO TO 660
  670 IF a$="r" OR a$="R" THEN GO TO 100
  675 IF a$="q" OR a$="Q" THEN CLEAR 65367: CLS : PRINT AT 10,10;" Loading...": LOAD ""
  680 IF a$<>"s" AND a$<>"S" THEN GO TO 660
  700 REM SAVE THE M/C TO TAPE
  710 SAVE "TRACER"CODE 65279,257
  720 PRINT #1;"VERIFY Y/N"
  730 LET A$=INKEY$: IF A$="" THEN GO TO 730
  740 IF A$="n" OR a$="N" THEN GO TO 600
  750 IF a$<>"Y" AND a$<>"y" THEN GO TO 730
  760 VERIFY ""CODE 65279,257
  770 GO TO 600
 9000 REM PRINT "PRESS ANY KEY"  
 9010 PRINT BRIGHT 1; PAPER 1; INK 7;AT 21,3;"PRESS ANY KEY TO CONTINUE"
 9020 RETURN 
 9100 REM DRAW PAGE HEADING
 9110 PRINT PAPER 2; INK 6;AT 1,12;" TRACER "
 9120 PAPER 0: INK 7
 9130 PLOT 91,171: DRAW 74,0: DRAW 0,-16: DRAW -74,0: DRAW 0,16
 9140 RETURN 
 9999 CLEAR : SAVE "TRINS" LINE 1
Scroll to Top