HP 3000 Manuals

MPE XL Arithmetic Traps [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation


Trap Handling Programmer's Guide

Chapter 2  MPE XL Arithmetic Traps 

Each trap in the arithmetic trap set detects a particular type of
arithmetic error, such as division by zero or result overflow.

Assuming that traps are enabled and that a user-written trap handler has
been armed, an arithmetic error causes control to be transferred to the
user-written trap handling procedure.

When a user process begins execution, the following hold:

 *  All arithmetic traps, except the IEEE floating-point exceptions, are
    enabled automatically.

 *  No user-written trap handler is armed.  This allows any arithmetic
    error to abort the process (unless a TRY/RECOVER block assumes
    control).

Through intrinsic calls, however, you can alter the ability of the
arithmetic traps to occur, and that of a software trap handler to be
invoked from any particular arithmetic trap.  Only enabled traps can
invoke a user-written trap handling procedure.

There are three MPE XL intrinsics used in dealing with arithmetic traps:

 *  ARITRAP

 *  HPENBLTRAP (NM only)

 *  XARITRAP

The ARITRAP intrinsic collectively enables all arithmetic traps (except
IEEE Floating Point Inexact Result) or disables all arithmetic traps.

The HPENBLTRAP intrinsic lets you selectively enable or disable specific
arithmetic traps.  This intrinsic provides you with more flexibility than
the ARITRAP intrinsic.

The XARITRAP intrinsic arms or disarms the user-written arithmetic trap
handling procedure.


NOTE ARITRAP is provided for compatibility with MPE V/E systems. HPENBLTRAP is provided on MPE XL to make available the full power of MPE XL trap handling.
The interrupts listed below are the arithmetic traps that you can enable or disable and for which you can arm a user-written trap handler. * Assertion Trap * 3000 Mode Packed Decimal Error * Paragraph Stack Overflow * Unimplemented Condition Traps * Software-detected Result of Pointer Arithmetic Misaligned or Error in Conversion From Long Pointer to Short Pointer * Software-detected NIL Pointer Reference * Range Errors * IEEE Floating Point, Invalid Operation * IEEE Floating Point Divide By Zero * IEEE Floating Point Overflow * IEEE Floating Point Underflow * IEEE Floating Point, Inexact Result * Decimal Divide By Zero * Invalid Decimal Digit * Invalid ASCII Digit * Decimal Overflow * 3000 Mode Double Precision Divide By Zero * 3000 Mode Double Precision Underflow * 3000 Mode Double Precision Overflow * Integer Overflow * 3000 Mode Floating Point Overflow * 3000 Mode Floating Point Underflow * Integer Divide By Zero * 3000 Mode Floating Point Divide By Zero Discussions of the intrinsics follow.


MPE/iX 5.0 Documentation