pTAL Conversion Guide

Hardware Indicators
pTAL Conversion Guide527302-002
20-9
Comparing Overflow Trapping in Native Processes
A program running as a TNS process can enable or disable overflow traps only by
using overflow trapping block attributes. Each time you enter or exit a block that
specifies a block overflow trapping attribute, your program enables or disables overflow
traps by executing a small number of TNS instructions that set or reset the T bit in the
TNS environment register.
Table 20-1 on page 20-9 shows how the overflow trapping state within a procedure is
affected by:
Whether you run your program as a TNS process or a native process
Whether the procedure’s caller has enabled or disabled overflow traps
Whether you specify overflow trapping by compiler directive, procedure attribute, or
block attribute
Table 20-1 on page 20-9 shows that:
For a native process, the trapping state of a procedure’s caller does not affect the
trapping state in the procedure it calls.
Specifying an overflow trapping attribute on a BEGIN-END block produces the same
trapping state for TNS and native processes, independent of the overflow trapping
state of the code that surrounds the BEGIN-END block.
For a TNS process, the overflow trapping procedure attribute has no effect. (Compare
#3 and #4 in Table 20-1 on page 20-9.)
For a TNS process, the overflow trapping compiler directive determines the trapping
state in the code that follows the outermost BEGIN-END block with an overflow
trapping attribute. (Compare #5 and #6 in Table 20-1 on page 20-9.)
Table 20-2 on page 20-11 shows the changes in the trapping state of code running as
TNS and native processes. Further comments follow Table 20-2 on page 20-11.
Table 20-1. Trapping State Within a Procedure (page 1 of 2)
# Statement Sequence
Process Type
TNS Native
Callers
Traps
Enabled
Callers
Traps
Disabled
1 ?NOOVERFLOW_TRAPS
PROC p;
BEGIN
...
END;
Enabled
Enabled
Enabled
Enabled
Enabled
Disabled
Disabled
Disabled
Disabled
Disabled
Disabled
Disabled
Disabled
Disabled
Disabled