HPENBLTRAP [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation
Trap Handling Programmer's Guide
HPENBLTRAP
Selectively enables or disables arithmetic traps.
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 only if
absolutely necessary.
Syntax
The HPENBLTRAP intrinsic is called as follows:
HPENBLTRAP(mask,oldmask);
Parameters
The HPENBLTRAP intrinsic has two required parameters:
mask 32-bit signed integer by value (required)
A value determining which arithmetic traps are
enabled and which are not.
oldmask 32-bit signed integer by reference (required)
Returns the value of the previous mask to your
program.
If a mask bit is on (=1), the corresponding trap is enabled. If bit is
off (=0), the corresponding trap is disabled. The bit and their
associated arithmetic errors are as follows:
Bit Trap Condition
---------------------------------------------------------------------------------------
(0:1) Assertion Trap.
(1:6) Reserved for MPE XL.
(7:1) 3000 Mode Packed Decimal Error
(8:1) Paragraph Stack Overflow.
(9:1) Unimplemented Condition Traps.
(10:1) Software-detected Misaligned Result Of Pointer Arithmetic or Error In
Conversion From Long Pointer To Short Pointer.
(11:1) Software-detected NIL Pointer Reference.
(12:1) Range Errors.
(13:1) IEEE Floating Point, Invalid Operation.
(14:1) IEEE Floating Point Divide By Zero.
(15:1) IEEE Floating Point Overflow.
(16:1) IEEE Floating Point Underflow.
(17:1) IEEE Floating Point, Inexact Result.
(18:1) Decimal Divide By Zero.
(19:2) Reserved for MPE XL.
(21:1) Invalid Decimal Digit.
(22:1) Invalid ASCII Digit.
(23:1) Decimal Overflow.
(24:1) 3000 Mode Double Precision Divide By Zero.
(25:1) 3000 Mode Double Precision Underflow.
(26:1) 3000 Mode Double Precision Overflow.
(27:1) Integer Overflow.
(28:1) 3000 Mode Floating Point Overflow.
(29:1) 3000 Mode Floating Point Underflow.
(30:1) Integer Divide By Zero.
(31:1) 3000 Mode Floating Point Divide By Zero.
NOTE The following apply to the preceding trap conditions represented in
the mask:
1. Native Mode supports two floating-point formats: IEEE and
3000 Mode. Both execute in Native Mode, 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.
2. Some of the error conditions specified here 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.
3. 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. This trap
can be produced by incorrect patches, corrupt code, or
invalid code sequences.
Condition Codes
The HPENBLTRAP intrinsic can return one of the following condition codes:
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