MPE XL Trap Handling Intrinsics [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation
Trap Handling Programmer's Guide
MPE XL Trap Handling Intrinsics
In MPE XL, all access to user-defined trap handling routines is
controlled by system intrinsics. The MPE XL trap handling intrinsics
deal with the following types of trap situations:
* Arithmetic trap
* Software Library trap
* Software System trap
* CONTROL-Y trap
Trap intrinsics can be invoked from within trap handling procedures.
Arithmetic Traps
An arithmetic trap handler reacts to arithmetic errors that occur as a
result of arithmetic operations. The ARITRAP intrinsic enables or
disables arithmetic traps. The XARITRAP intrinsic arms or disarms the
user-written arithmetic trap handler. The HPENBLTRAP is similar in
function to ARITRAP, but allows you greater flexibility in selectively
enabling or disabling arithmetic traps.
Software Library Traps
A software library trap handler reacts to errors that occur during
execution of procedures from the compiler libraries. You can arm or
disarm your software library trap handler with the XLIBTRAP intrinsic.
Software System Traps
A software system trap handler reacts to certain errors that occur when
user programs call intrinsics incorrectly. You arm or disarm your
software system trap handler by means of the XSYSTRAP intrinsic.
CONTROL-Y Traps
If you are running a program in an interactive session, you can invoke a
special trap that transfers control in the program to an armed,
user-defined trap handling procedure when you enter a CONTROL-Y subsystem
break signal from the terminal. On most terminals, this signal is
transmitted by pressing the [[Y]] key while holding down the [[CTRL]]
key. The XCONTRAP intrinsic arms or disarms the user-written CONTROL-Y
trap handling procedure.
If you send another CONTROL-Y signal, MPE XL ignores it unless you call
the RESETCONTROL intrinsic at some point prior to the signal.
Code-related Traps
Code-related traps are handled solely by the MPE XL trap subsystem (that
is, users cannot define their own routines to handle these traps).
Code-related traps can occur as a result of illegal or incorrect coding
practices.
MPE/iX 5.0 Documentation