HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions

HPENBLTRAP

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM callable only.

Selectively enables or disables arithmetic traps.

Syntax

              I32V    I32

   HPENBLTRAP(mask,oldmask);

Parameters

mask

32-bit signed integer by value (required)

Passes a value indicating which arithmetic traps are enabled and which are not:

  • If a bit is on (=1), the corresponding trap is enabled.

  • If a bit is off (=0), the corresponding trap is disabled.

The bits and their associated arithmetic errors are:

BitsValue/Meaning
31:13000 mode floating-point divide by zero
30:1Integer divide by zero
29:13000 mode floating-point underflow
28:13000 mode floating-point overflow
27:1Integer overflow
26:13000 mode double-precision overflow
25:13000 mode double-precision underflow
24:13000 mode double-precision divide by zero
23:1Decimal overflow
22:1Invalid ASCII digit
21:1Invalid decimal digit
19:2Reserved for the operating system
18:1Decimal divide by zero
17:1IEEE floating-point, inexact result
16:1IEEE floating-point underflow
15:1IEEE floating-point overflow
14:1IEEE floating-point divide by zero
13:1IEEE floating-point, invalid operation
12:1Range errors
11:1Software-detected NIL pointer reference
10:1Software-detected misaligned result of pointer arithmetic or error in conversion from long pointer to short pointer
9:1Unimplemented condition traps
8:1Paragraph stack overflow
7:13000 mode packed decimal error
1:7Reserved for MPE/iX
0:1Assertion trap

NOTE: The following apply to various trap conditions represented in the mask parameter:
  • 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.

  • Some error conditions specified are not strictly arithmetic traps (for example, range errors, nil pointers, and paragraph stack overflow). However, 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.

oldmask

32-bit signed integer by reference (required)

Returns the value of the previous mask to the program.

Operation Notes

Allows selective enabling or disabling of arithmetic traps. It provides more flexibility than the ARITRAP intrinsic, which collectively enables or disables 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 a Pascal/XL TRY statement has been executed, control is passed to the recover block by doing an escape.

    • If a Pascal/XL TRY statement has not been executed, an error message is output and the process aborts.

  • If a trap is disabled, irrespective of whether it is armed, the trap is ignored, and execution of the process continues without any interruption.

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 result in an inexact trap if the IEEE inexact result trap is enabled.

Condition Codes

CCE (2)

Request granted. All traps were originally disabled.

CCG (0)

Request granted. At least one trap was originally enabled.

CCL (1)

Not returned.

Related Information

Intrinsics

None

Commands

None

Manuals

Trap Handling Programmer's Guide (32650-90026)

Feedback to webmaster