By Dan Carmichael — originally published in COMPUTE!’s Gazette Issue 2, August 1983
Here’s short program to vary the speed of your listings without using any BASIC programming memory.
One small inconvenience of programming with the VIC-20 or Commodore 64 (if you don’t have printer) is the limitation of being able to display only relatively small sections of your programs on the screen at one time. If you have large BASIC program, listings of the program can be hard to follow. Even slowing down the LIST command with the CTRL key isn’t much help at times; the BASIC lines still pass by at reasonably fast rate, and because of the way the lines “jump,” they can be hard to follow.
The short programs that follow (one for the VIC and another for the 64) will help slow things down for you. It is “Four-Speed Brake” that will let you vary the speed of your listings from reasonably slow to complete stop. The program is written in machine language, and normally sits undisturbed in some available memory called the cassette buffer. Once it is POKEd into memory, it will use none of your available BASIC programming memory. The VIC version works with either the unexpanded or expanded VIC.
How to Use the Program
First, load your BASIC program into the computer, then either append this program onto it, or type it in after your program. Before running the program for the first time, verify it carefully, and save it to tape or disk. An error in this (or any) machine language program can cause your system to “crash,” forcing you to turn your computer off/on to reset. After verification, type RUN 60000 and press RETURN to POKE the machine language program into the cassette buffer. Then type SYS828 and press RETURN. The Four-Speed Brake is now running.
The program is controlled by the special function keys. The chart illustrates what the function keys do.
To stop Four-Speed Brake, press RUN/STOP-RESTORE; to restart, enter SYS828.
After the Four-Speed Brake has been success fully POKEd into memory and tested, you may, if you wish, delete lines 60000-60040. Also, the CTRL key will still work as it normally does in slowing down your listings, and might be considered “fifth speed,” little faster than the F-1 key.
The Four-Speed Brake also has another important benefit. It will slow down or stop the running of your BASIC program just as it slows the LIST command. This can be very useful tool for debugging your BASIC program. To do this, use the Four-Speed Brake in the same manner as you would for the LIST command; enter SYS828 then run your program. The function keys will then slow down or stop your BASIC program in the same fashion.
Special Function Keys
F-1 fastest speed
F-3 medium speed
F-5 slowest speed
F-7 complete stop
Words of Caution
First, this program runs in the cassette buffer, and as is true with all programs in this buffer, you cannot use the tape cassette while this program is running. Second, because of the way the computer outputs the lines while listing programs, you will encounter a glitch every now and then. It will appear as if one line repeats itself. If you continue to hold down the function key and let the screen scroll, it will take care of itself. You can observe why this happens if you list program while holding down the F-5 key.
For you machine language programmers, the Four-Speed Brake will also work for you, both in listing and running your ML programs. To use, enter SYS828, then SYSXXX into your ML monitor as usual, or SYSXXX into your machine language program. However, word of caution is needed here. The Four-Speed Brake uses all three registers (A, X, and Y), so you’ll have to be careful when using these registers in your own program.
See program listings on page 125.
