Hardware Reference
In-Depth Information
C ODE W ARRIOR D EBUGGER S CREEN
The debugger screen is divided into eight small windows. Not all the windows are useful in the
debug session. The user can get rid of those windows that are of no interest by clicking on the 3
symbol of that window's upper right corner. In this tutorial, we get rid of the Procedure window and
resize the Source so that more statements of the main function can be displayed at the same time.
The windows within the debugger screen can be moved around and resized. The Data:1 win-
dow displays the global variable ( ave ) and its value. The Data:2 window displays the local vari-
ables ( max , min , i , and arr ) and their values.
The Assembly window shows how the main function is translated into assembly language.
The main function has four local variables (one is an array with 30 elements) and needs 66 bytes
to hold them. The first instruction, LEAS 266,SP allocates space in the stack to these local
variables. The following instructions pushed the initial values of the array into the stack (push-
ing one value requires three instructions):
ldab
#50
clra
std
6,SP
. . .
D EBUGGER C OMMANDS
CodeWarrior debugger provides commands to support debug activities. By pressing the
right mouse button on any statement of the main function or other function, one can see all the
debug commands supported by the debugger as shown in Figure 5.22.
If we single-step (by clicking on the corresponding icon shown in Figure 3.35) the program a
few times, we can see that the debugger steps over three instructions to push one array element
into the stack.
Figure 5.22 CodeWarrior debugger commands
 
Search WWH ::




Custom Search