
B–61863E–1/06
5. TUTORIAL
GENERAL
33
b. Search the function with the base GDT(32), which has the nearest
offset value below 00000408H, in the map file tutorial.map.
MODULE = TASK1
PUBLIC NAME BASE OFFSET TYPE WC ABSOLUTE ADDRESS
CRT_SIZE14 . . GDT(33) 0000H INTEGER(2) 0 00000000H
DISP_COUNTER . GDT(32) 032EH PROCEDURE NEAR16 0 0084555EH
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GET_KEY. . . . GDT(32) 02E8H PROCEDURE INTEGER(2) NEAR16 0 00845518H
PHASE.....GDT(33) 0002H INTEGER(2) 0 00000002H
TASK1.....GDT(32) 0254H PROCEDURE FAR16 0 00845484H
←File
032Eh is the nearest offset to a value below 00000408H with
GDT(32).
This shows, that the system error occurs in the function
disp_counter().
The error occurs at 0408 in the file task1.obj referring to error
message, and the offset of the function is 032EH. The difference
is calculated as follows: 0408 – 032E = 0DAH.
This value is necessary to find the error location in the list file.
c. Searching the erroneous source code in the list file of task1.c
; STATEMENT # 56
disp_counter PROC NEAR
026A C8020000 ENTER 2H,0H
@14:
; STATEMENT # 59
026E 680900 PUSH 9H
0271 680000 PUSH 0H
0274 9A00000000 CALL pl_mem2
0279 26FF7702 PUSH ES:[BX+2H]
027D 26FF37 PUSH ES:[BX]
←top of the function
In the list file, the offset at the top of the function disp_counter()
is 026A. The result of the calculation 026A + 0DA = 0344 is the
erroneous offset value in the list file.
; STATEMENT # 70
0339 680900 PUSH 9H
033C 681027 PUSH 2710H
033F 9A00000000 CALL pl_mem2
0344 26FF7702 PUSH ES:[BX+2H]
0348 26FF37 PUSH ES:[BX]
034B 680A00 PUSH 0AH
034E B86801 MOV AX,OFFSET(@@LONG$CONSTANT$0168H)
0351 0E PUSH CS ; 4
0352 50 PUSH AX ; 5
0353 E80000 CALL printf
0356 81C40A00 ADD SP,0AH
; STATEMENT # 72
The number of the statement which includes the erroneous code
is equal to line number of the code in the source file task1.c. In
this case the error could be located in line 70 or 71, because the
argument of the function exceeds one line.
67 printf(”¥x1b[%d;0H %d OTHERS %10lu”,
68 4+TOOL_MAX, 1+TOOL_MAX, *pl_memul2(D, OTHER_TOOL_TIME));
69 printf(”¥x1b[%d;0H ”, 5+TOOL_MAX);
70 printf(”¥x1b[%d;0H TOTAL %10lu”,
71 6+TOOL_MAX, *pl_memul2(D, ALL_TIME));
72