170 Debugging Stepping Through Programs "Logic" difficulties are some of the hardest problems to solve in debugging programs. In batch environments, the usual solution is to print the contents of variables at critical points in the program or to print dump.s. The capabilities for both of these methods are provided. However, advantage has been taken of the interactive, "hands-on" nature of the 9835A/ B and a feature has been added which allows you to execute the assembly statements individually. This permits you to examine the flow of the program as it executes rather than having to decipher a dump or trying to print the contents of specific variables at what you guess is the critical point.
If you are desirous of looking only at particular points in the program, or at particular variables, there is also the ability to establish "break points" for these items, so that your debugging routines can be invoked only when certain conditions arise. You can also establish different routines for different break points, adding to the flexibility. Individual Instruction Execution whenever you press the 8 key, the line which is currently executing is allowed to finish Normally, all BASIC lines, including the ICALL statement, act as a unit. That is to say, before the program is actually interrupted.
Thus, if you press 8 during execution of the line - :L!2iU L..ET Fi::::t +:t the line finishes and the variable A contains the value 2. Then the 8 takes effect. The same is true of a line containing an ICALL statement. For example, if you press 8 during the execution of- then the assembly routine completes before the 8 is honored. This is not always desirable; especially not during debugging of the assembly routine. It does not allow you to look at the execution of the routine to help you determine what may be going wrong. The same problem occurs with the @ill key. Pressing I SllP I causes an entire BASIC line to be executed.
Thus, if you stepped through line 120 as above, the entire routine Sort would be executed, and you would not be able to observe its execution on an instruction-by-instruction basis.