pTAL Conversion Guide

Hardware Indicators
pTAL Conversion Guide527302-002
20-6
ENABLE_OVERFLOW_TRAPS Block Attribute
The object code produced by the native compiler for Example 20-2 on page 20-5:
Disables traps for procedure x
Enables traps for procedure y
Disables traps for procedure z
Enables traps for subprocedure s
Disables traps upon returning from subprocedure s to the site in Z from which S
was called.
ENABLE_OVERFLOW_TRAPS Block Attribute
In both TAL and pTAL, you can use the following syntax to specify whether overflow
traps are enabled or disabled within the scope of a BEGIN-END block:
Unlike the overflow traps compiler directive and overflow traps procedure directive,
which do not have the same effect for code produced by the TAL and native compilers,
the BEGIN-END block overflow attributes have the same effect, regardless of whether
you compile your program by using pTAL to run as a native process or by using TAL to
run as a TNS process.
Upon entering a BEGIN-END block that specifies ENABLE_OVERFLOW_TRAPS or
DISABLE_OVERFLOW_TRAPS, the TAL compiler generates TNS instructions that set
or reset, respectively, the T bit in the environment register.
Your code can exit a BEGIN-END block by executing a GOTO statement that branches
out of the block or by arriving at the end of the code within the block. Upon exiting a
BEGIN-END block that specifies ENABLE_OVERFLOW_TRAPS or
DISABLE_OVERFLOW_TRAPS, the TAL compiler generates code to restore the T bit
in the environment register as follows:
If an encompassing BEGIN-END block specifies an overflow trapping attribute, the
TAL compiler sets the T bit to the overflow trapping attribute specified on the
innermost such block
If no encompassing BEGIN-END block specifies an overflow trapping attribute, the
TAL compiler sets the T bit according to whether a OVERFLOW_TRAPS or
NOOVERFLOW_TRAPS compiler directive that was in effect when pTAL compiled
the procedure head.
BEGIN
: ENABLE_OVERFLOW_TRAPS
DISABLE_OVERFLOW_TRAPS
VST682.vsd