pTAL Conversion Guide

Hardware Indicators
pTAL Conversion Guide527302-002
20-4
Static T Flag
Static T Flag
TAL programs can test TNS architecture’s T bit dynamically, but pTAL provides a
“static T flag” with which you specify whether traps are enabled or disabled at any point
in your program. Unlike a TAL program, however, in which the trapping state of a
procedure is determined at run time by the state of the environment registers T bit, in
pTAL programs that you run as native processes, the trapping state is always
determined by the state of the static T flag when you compile your program. You
manipulate the static T flag using the previously mentioned pTAL constructs, which are
described further in the following topics.
The overflow trapping state of code compiled by using the native compiler is always
based on the attributes and compiler directives in effect when each statement in your
program is compiled. Procedures do not inherit the trapping state of their callers.
The overflow trapping state of a pTAL program running as a native process is
controlled by the three previously mentioned syntactic elements. The overflow trapping
state of a pTAL program running as a TNS process is:
Only partially affected by the compiler directive
Not affected by the procedure attribute
Controlled precisely by the clauses on a BEGIN-END block
OVERFLOW_TRAPS Directive
For syntax, see OVERFLOW_TRAPS on page 19-24.
TAL
You can specify the OVERFLOW_TRAPS directive, but it does not ensure the trapping
characteristics of your program—the directive does not affect directly the object code
generated by the compiler except at the end of a BEGIN-END block. See
ENABLE_OVERFLOW_TRAPS Block Attribute on page 20-6 for more details.
pTAL
You can specify the OVERFLOW_TRAPS directive to enable or disable overflow traps.
The OVERFLOW_TRAPS directive specifies the default value of a pTAL program’s
overflow trapping behavior when you run it as a native process.
Example 20-1. OVERFLOW_TRAPS Directive (page 1 of 2)
?OVERFLOW_TRAPS ! Correct use of OVERFLOW_TRAPS directive
PROC p;
BEGIN
?NOOVERFLOW_TRAPS ! Incorrect use of OVERFLOW_TRAPS directive:
... ! must appear between procedure declarations
END;