ARITRAP [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation
Trap Handling Programmer's Guide
ARITRAP
Collectively enables or disables arithmetic traps.
NOTE When arithmetic traps are ignored (disabled) on MPE XL, the results
are not guaranteed to be identical to those on MPE V/E. On MPE XL,
a better way to prevent arithmetic traps is to use compiler
directives, for example, $ovflcheck off$ in HP Pascal/XL.
When compiler directives are used, the compiler generates
arithmetic instructions that do not trap on overflow. This is a
more natural way of preventing arithmetic traps. When arithmetic
traps are ignored using ARITRAP, the trap actually takes place, but
the MPE XL trap subsystem recovers from the trap and takes the
action required to continue execution.
Syntax
The ARITRAP intrinsic is called as follows:
ARITRAP(trapstate);
Parameters
The ARITRAP intrinsic has one required parameter:
trapstate 32-bit signed integer by value (required)
A value enabling or disabling arithmetic traps.
Enter 0 if you want to disable arithmetic traps
or 1 if you want to enable all traps except the
IEEE inexact result trap.
NOTE By default, all traps except IEEE floating-point exceptions are
enabled, and the system trap handler is armed. Many floating-point
operations result in an inexact result. Consequently, most
compiler libraries doing floating-point operations will result in
an inexact trap if the IEEE Inexact Result trap is enabled.
Therefore, you should enable the IEEE Inexact Result trap (using
the HPENBLTRAP intrinsic) only if absolutely necessary.
Condition Codes
The ARITRAP intrinsic can return one of the following condition codes:
CCE Request granted. All arithmetic traps were originally
disabled.
CCG Request granted. At least one arithmetic trap was
originally enabled.
CCL Not returned by this intrinsic.
MPE/iX 5.0 Documentation