Statement offset addresses
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.
- Under the BLKOFF option, this offset is the offset of the instruction from the primary entry point for the function or subroutine to which it belongs. Thus under this option, the offsets are reset with each new block.
- Under the NOBLKOFF option, this offset is the offset of the instruction from the start of the compilation unit. Thus under this option, the offsets are cumulative.
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 runtime 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 Table 1, the message indicates that the condition was raised at offset +98 from the SUB1 entry. The compiler listing excerpt shows this offset associated with line number 8. The runtime output from this erroneous statement is shown if Table 2.
|
|
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.