HPENBLTRAP (NM) (new) [ Introduction to MPE XL for MPE V Programmers Migration Guide ] MPE/iX 5.0 Documentation
Introduction to MPE XL for MPE V Programmers Migration Guide
HPENBLTRAP (NM)
(new)
The MPE XL NM intrinsic HPENBLTRAP corresponds to the MPE V/E and CM
ARITRAP intrinsic. Both selectively enable or disable arithmetic traps,
but HPENBLTRAP provides you with more flexibility.
Arming and Enabling Traps
There is a difference between arming and enabling traps. Enabling a trap
means that the occurrence of a trap condition is not ignored. Arming a
trap is required so that, on a trap condition, a user-written routine is
invoked and can take appropriate recovery actions.
The following list summarizes what can occur when an arithmetic trap
condition arises:
* If a trap is both enabled and armed, the user-written trap handler is
invoked whenever a trap condition occurs.
* If a trap is enabled but not armed, one of two situations applies:
* If you have executed an HP Pascal/XL TRY statement, control is
passed to the RECOVER block by doing an ESCAPE.
* If you have not executed a HP Pascal XL TRY statement, an error
message is output and the process aborts.
* If a trap is disabled, irrespective of whether it is armed or not,
the trap is ignored, and execution of the process continues
uninterrupted.
Real Number and Arithmetic Traps
NM supports two floating point formats: IEEE and HP3000 Mode. Both
execute in NM, but 3000 Mode performs HP 3000 type manipulations. Since
it is possible to use both formats during program execution, there are
separate bits in the mask for enabling/disabling traps of these formats.
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 [bit
(17:1)] only if absolutely necessary.
HPENBLTRAP Parameters
Two HPENBLTRAP parameters are required: oldmask and mask.
The oldmask parameter accepts a 32-bit signed integer passed by reference
and returns the value of the previous mask to your program.
The mask parameter, a 32-bit signed integer passed by value, indicates
the current mask. You indicate, bit by bit, which traps you want enabled
or disabled according to the correspondence code listed in the MPE XL
Intrinsics Reference Manual (32650-90028).
For example, if bit 30 is set to 0, the Integer Divide by Zero trap is
off; and if bit 17 is set to 1, the IEEE floating point inexact result
trap is on.
Some of the specified error conditions are not strictly arithmetic traps
(for example, range errors, NIL pointers, and paragraph stack overflow).
However, they and many arithmetic traps are caught by reserved
instructions that raise the conditional traps. For this reason, all are
enabled/disabled by HPENBLTRAP.
Some of the instructions that raise conditional traps are reserved to
indicate some of the above trap conditions. A nonreserved instruction is
one not generated by a compiler. If a nonreserved instruction causes a
conditional trap, this is reported as an Unimplemented Condition Trap.
HPENBLTRAP Condition Codes
The following Condition Codes apply to HPENBLTRAP:
CCE Request granted. All traps were originally disabled.
CCG Request granted. At least one trap was originally
enabled.
CCL Not returned by this intrinsic.
MPE/iX 5.0 Documentation