
B–61863E–1/06
9. C-PROGRAM MEMORY DISPLAY
AND DEBUG FUNCTION
APPLICATION
PROGRAMMING GUIDE
435
This example sets a break point at statement 489 (*b) of the sample
C-program and checks the contents of variables F_DSPSAVE,
F_GROPEN, and SYS.
<Determining a break point address>
(1) Get the segment address of the main routine from the MAP listing.
MAIN GDT(34) 0774H (*e). . . . . . . . . . . . . . . . . . . . . . . . . . .
MAP shows that the GDT(34) selector is 0113H (*c). . . . . . . . . . .
→The segment address of the main routine is 0113 : 0774
.
(2) Get the address of STATEMENT # 389 from the machine-code
listing.
D MAIN offset address= 0774H (*a1). . . . . . . . . . . . . . . . . . . . . . .
D STATEMENT # 489 offset address = 07E1H (*b1). . . . . . . . . .
Because the segment address of the main routine is 0113 : 0774, the
segment address of STATEMENT # 489 is 0113 : 07E1.
Set the break address to 0113 : 07E1
.
(3) Get the segment addresses of variables F_DSPSAVE, F_GRPOPEN,
and SYS from the MAP listing (*d). . . . . . . . . . . . . . . . . . . . . . . .
F_DSPSAVE GDT(35) 0010H INTEGER(2). . .
F_GRPOPEN GDT(35) 0012H INTEGER(2). .
SYS GDT(35) 0000H INTEGER(2). . . . . . . . . .
MAP shows that the GDT(35) selector is 011BH (*c). . . . . . . . . . .
Set the segment addresses (dump addresses) as follows:
F_DSPSAVE 011B:0010. .
F_GRPOPEN 011B:0012.
SYS 011B:0000. . . . . . . . .
(4) Press the RUN soft key to start the sequence program, then check data
on the dump data screen after a break occurs.
NOTE
Create external symbols for the break address and dump
data (variables) so that the addresses can be checked in the
MAP listing.
The local variables of functions are not output in the MAP
listing.
9.3.6
Example of Using the
Debug Function