home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 11 / 011.d81 / trace.example (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  2KB  |  57 lines

  1. 5 if a=1 then 200
  2. 6 ifa=>2then63000
  3. 7 gosub60000
  4. 10 rem basic trace utility example
  5. 20 print "[147]"
  6. 30 print "      **** basic trace utility ****"
  7. 40 print
  8. 50 print "[212]he basic trace utility is a machine"
  9. 60 print "language routine that will show you"
  10. 70 print "the line number of each basic statement"
  11. 80 print "as it executes."
  12. 90 print
  13. 100 print "[198]irst, load the utility:"
  14. 110 print "load "chr$(34)"trace.ojb"chr$(34)",8,1"
  15. 120 if a=0 then a=1:load "trace.obj",8,1
  16. 200 print
  17. 210 print "[212]ype:":print"sys 49152"
  18. 220 print "to turn the trace on and off."
  19. 230 print "(note that the sys can be used in"
  20. 240 print "in a program also!)"
  21. 250 print "press any key for an example"
  22. 260 getk$:if k$="" then 260
  23. 300 print "[147]"
  24. 310 print "counting to 10 without trace:"
  25. 320 gosub 1000
  26. 330 print "counting with trace on:"
  27. 340 sys49152:gosub 1000:sys49152
  28. 350 print:print:print
  29. 999 goto62000
  30. 1000 for x=1to 10
  31. 1010 print x;
  32. 1020 next x
  33. 1030 print
  34. 1040 return
  35. 60000 t$="                         ":c=0:c$="":print"[147]":poke53281,0
  36. 60030 printspc(7)""t$:printspc(7)"      [212]race [197]xample      [146]"
  37. 60051 printspc(7)""t$:print:printtab(18)"by"
  38. 60060 print:printspc(12)"[208]aul [202]atkowski"
  39. 60070 print:printspc(12)"[195]opyright 1985"
  40. 60080 print:print:print:print"     [204][207][193][196][211][212][193][210] is not public domain."
  41. 60090 print:print"  [208]lease respect the author's rights."
  42. 60100 print:print"      [208]ress space bar to continue."
  43. 60110 forcc=1to48:getk$:ifk$=" "then60130
  44. 60120 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
  45. 60125 next:goto60100
  46. 60130 printc$:return
  47. 62000 print"[215]ould you like to see it again?"
  48. 62010 poke198,0:wait198,1:geta$:ifa$="y"thenrun
  49. 62020 ifa$="n"then63000
  50. 62030 poke53280,rnd(1)*15:goto62010
  51. 62050 :
  52. 63000 rem    connect back to ls
  53. 63010 ifa=1thena=2:load"routines v4",8,1
  54. 63020 ifa=2thena=3:load"sidirq v3",8,1
  55. 63030 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  56. 63040 poke631,13:poke632,13:poke198,2:end
  57.