CRE Programmer's Guide

CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-49
Hardware Traps
If an error occurs in a math function and traps are disabled in the routine that called the
math function, control is returned to the caller:
REAL r, s;
r := -1.0E0;
CALL disable_overflow_traps; ! A user-written routine that
s := RTL_Sqrt_Real32_( r ); ! disables overflow traps
IF $OVERFLOW THEN ! Control returns here: test
BEGIN ! error in Sqrt routine
...
END;
If traps are enabled when a math function detects an error, the system transfers control
to the current trap handler upon return from the function:
REAL r, s;
r := -1.0E0;
CALL enable_overflow_traps; ! A user-written routine that
s := RTL_Sqrt_Real32_( r ); ! enables overflow traps
IF $OVERFLOW THEN ! Program does not reach this
BEGIN ! statement because the
... ! system transfers control to
END; ! the current trap handler
Hardware Traps
Hardware traps are exception conditions detected by the hardware of the processor on
which your program is running. The following traps can be reported:
Except for trap 4, arithmetic fault, the CRE treats all of the preceding traps as fatal and
terminates your program.
Catastrophic Errors
The CRE and the run-time libraries maintain data in the upper 32K words of the user
data segment and in extended memory. If your program uses a small-memory model,
the CRE maintains the user heap in a portion of the lower 32K words of the user data
segment.
CRE Message Number Hardware Trap
2 Illegal address reference
3 Instruction failure
4 Arithmetic fault
5 Stack overflow
6 Process loop-timer timeout
7 Memory manager read error
8 Not enough physical memory
9 Uncorrectable memory error
10 Interface limit exceeded