Debugging
At this stage the errors in the programs are detected and corrected. This stage of program development is an important process. Debugging is also known as program validation.
Some common errors which might occur in the programs include:
§ Un initialization of variables,
§ Reversing of order of operands
§ Confusion of numbers and characters,
§ Inverting of conditions eg jumping on zero instead of on not zero
The tools or methods which can be used to debug the programs include:
· Simulator -This is a computer program which simulates the execution of the program on another computer.
· Logic Analyzers: This test instrument detects the states of digital signals during each clock cycle and stores them in memory. It then displays this data on the monitor.
· Breakpoints: This is introduced in the program to halt the execution at some intermediate point. At this point, the values of the various inputs, outputs, variables etc. can be checked.
· Software interrupts: This is an instruction which saves the current value of the program counter and then branches to a specific memory location. At this location there is the debugging program which displays the status information.
· Memory dump: This gives a listing of the current contents of a section of the memory. Memory dumps are common in most simulator programs, and microcomputer systems.
· Trace routine: This program prints the current status of the processor at specified intervals.