If the LIST compile option is used, the compiler includes a pseudo-assembler listing in the compiler listing. This listing includes, for each instruction, an offset whose meaning depends on the setting of the BLKOFF compiler option:
The pseudo-assembler listing also includes, at the end of the code for each block, the offset of the block from the start of the current module (so that the offsets shown for each statement can be translated to either block or module offsets).
These offsets can be used with the offset given in a run-time error message to determine the statement to which the message applies.
The OFFSET option produces a table that gives for each statement, the offset of the first instruction belonging to that statement.
In the example shown in Figure 2, the message indicates that the condition was raised at offset +58 from the SUB1 entry. The compiler listing excerpt shows this offset associated with line number 8. The run-time output from this erroneous statement is shown if Figure 3.
Compiler Source
Line.File
2.0 TheMain: proc options( main );
3.0 call sub1();
4.0 Sub1: proc;
5.0 dcl (i, j) fixed bin(31);
6.0
7.0 i = 0;
8.0 j = j / i;
9.0 end Sub1;
10.0 end TheMain;
. . .
OFFSET OBJECT CODE LINE# FILE# P S E U D O A S S E M B L Y L I S T I N G
000000 00002 | THEMAIN DS 0D
. . .
00004C 5800 C1F4 00002 | L r0,_CEECAA_(,r12,500)
000050 5000 D098 00002 | ST r0,#_CEECAACRENT_1(,r13,152)
000054 5810 D098 00000 | L r1,#_CEECAACRENT_1(,r13,152)
000058 5820 3062 00000 | L r2,=Q(@STATIC)(,r3,98)
00005C 4152 1000 00000 | LA r5,=Q(@STATIC)(r2,r1,0)
000060 18BD 00003 | LR r11,r13
000062 5800 D098 00003 | L r0,#_CEECAACRENT_1(,r13,152)
000066 5000 C1F4 00003 | ST r0,_CEECAA_(,r12,500)
00006A 58F0 3066 00003 | L r15,=A(SUB1)(,r3,102)
00006E 05EF 00003 | BALR r14,r15
000070 00010 | @1L1 DS 0H
000070 5810 5000 00010 | L r1,IBMQEFSH(,r5,0)
000074 58F0 1008 00010 | L r15,&Func_&WSA(,r1,8)
000078 5800 100C 00010 | L r0,&Func_&WSA(,r1,12)
00007C 5000 C1F4 00010 | ST r0,_CEECAA_(,r12,500)
000080 05EF 00010 | BALR r14,r15
000082 00010 | @1L4 DS 0H
000082 5800 D098 00002 | L r0,#_CEECAACRENT_1(,r13,152)
000086 5000 C1F4 00002 | ST r0,_CEECAA_(,r12,500)
. . .
000000 00004 | SUB1 DS 0D
. . .
000048 4100 0000 00007 | LA r0,0
00004C 5000 D098 00007 | ST r0,I(,r13,152)
000050 5840 D09C 00008 | L r4,J(,r13,156)
000054 8E40 0020 00008 | SRDA r4,32
000058 1D40 00008 | DR r4,r0
00005A 1805 00008 | LR r0,r5
00005C 5000 D09C 00008 | ST r0,J(,r13,156)
Message :
IBM0301S ONCODE=320 The ZERODIVIDE condition was raised.
From entry point SUB1 at compile unit offset +00000058 at
address 0D3012C0.Entry offsets given in dump and ON-unit SNAP error messages can be compared with this table and the erroneous statement discovered. The statement is identified by finding the section of the table that relates to the block named in the message and then finding the largest offset less than or equal to the offset in the message. The statement number associated with this offset is the one needed.