MPE/iX Intrinsics Reference Manual (32650-90905)

638 Chapter10
Command Definitions (QUIT-ZSIZE)
XARITRAP
bits in the mask for enabling/disabling traps of these formats.
Some error conditions specified here 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
XARITRAP.
Some instructions that raise conditional traps are reserved to indicate the
above trap conditions. A nonreserved instruction is one not generated by a
compiler. If a nonreserved instruction causes a conditional trap, it is
reported as an unimplemented condition trap. Only assembly language
programmers can generate such a trap.
plabel
(NM) 32-bit signed integer by value (required)
(CM) 16-bit signed integer by value (required)
Passes the address of the trap handling procedure. If the value is 0, the
user-written arithmetic trap handler is disabled.
oldmask
(NM) 32-bit signed integer by reference (required)
(CM) 16-bit signed integer by reference (required)
Returns the value of the previous
mask
.
oldplabel
(NM) 32-bit signed integer by reference (required)
(CM) 16-bit signed integer by reference (required)
Returns the
plabel
of the process's previous arithmetic trap handler. If no
plabel
was previously configured, 0 is returned.
Operation Notes
This trap can be armed for any combination of events; at any given time, there is only one
user-written trap handler for all armed 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 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 is executed, control is passed to the RECOVER block
by doing an ESCAPE.
If a Pascal XL TRY statement is executed, an error message is output and the
process aborts.