home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1992 March & April / rerun-1992-03-04-side-a.d64 / bhound.txt < prev    next >
Text File  |  2022-09-20  |  2KB  |  17 lines

  1. A BASIC PROGRAMMER'S BEST FRIEND
  2. By Stephen Dirschauer
  3.  
  4. Because Commodore Basic 2.0 is easy to alter and test, it's relatively easy to debug.  It does, however, have one major fault: It doesn't give you feedback.  When a program is running, it's impossible to know what's happening internally; the only way you can guess is by interpreting what you see on the screen.
  5.  
  6. Basic Bloodhound can help.  It's a C-64 machine language program that runs in the background, maintaining a constant display of the current line number and the value of any variable you choose.
  7.  
  8. BLOODHOUND is a Basic loader that creates BB, the machine language file you'll actually use when debugging.  ReRUN's Menu 64 program will automatically copy the necessary files to a work disk.  To make additional copies of Basic Bloodhound, load and run BLOODHOUND.HEX.  To use the program, load and run BLOODHOUND from either Menu 64 or from a work disk.
  9.  
  10. As you set the Basic Bloodhound on the trail of a bug, you need to slow down the program, or the line numbers will scroll by too quickly.  Therefore, when activating BB set the speed with the command SYS 50222,SPEED where speed is a number from 0 to 255, 0 being the fastest.
  11.  
  12. Basic Bloodhound automatically monitors the first variable that the program uses, so you must put the variable you want to trace ahead of any others.  That doesn't mean you have to rearrange your program; just insert a line mentioning the variable among the first few lines.  For instance, if you wanted to have BB display the contents of the string UR$, you could add the line 0 READING 0 UR$=""
  13.  
  14. The command SYS 50222, SPEED turns the tracer on and off, so you can activate and deactivate it within your own program.  This is handy when it slows down a section of the program you've already tested.
  15.  
  16. I have one word of caution: Don't use the Basic Bloodhound program if things crash royally when you're debugging.  There may be a conflict with the memory locations that the tracer uses (50222-50550, or $C42E- $C576).  
  17.