HP 3000 Manuals

Handling Software System Traps [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation


Trap Handling Programmer's Guide

Handling Software System Traps 

Information relating to the system trap is passed to the system trap
handling routine through its four parameters:

trapcode                  32-bit signed integer passed by value 

                          A constant value that is useful when the same
                          trap handler is used to handle different types
                          of system traps.

intrinsicnum              32-bit signed integer passed by value 

                          A unique intrinsic identifier (ID).

                          See Appendix C for a complete list of intrinsic
                          numbers.

intrinsicerr              32-bit signed integer passed by value 

                          A number that identifies the error detected by
                          the intrinsic.  If the error is greater than
                          20, the error is specific to a given intrinsic.
                          Otherwise, the number identifies a general
                          intrinsic error.

parmnum                   32-bit signed integer passed by value 

                          A number that identifies the error-causing
                          parameter that was passed to the intrinsic.  If
                          the error is not caused by a parameter, then
                          zero is passed as the parmnum value.


NOTE An NM system trap handling routine differs from a CM system trap handler in its calling sequence [refer to the Introduction to MPE XL for MPE V Programmers (30367-90005)] and the method by which the trap routine obtains error information. However, you need supply only the version for the mode in which you invoke intrinsics. You do not need to modify existing CM applications that use a system trap handler in order to run them on MPE XL. Likewise, new NM applications need not specify a CM version of their NM trap handling routine. Only those doing mixed-mode programming, who invoke intrinsics in both modes, need to specify and arm trap handling routines in both modes in order to capture all possible system traps.

CAUTION A user-defined trap handling procedure cannot perform a goto out of that procedure. The state of the process and the program results are not predictable after a non-local goto. Performing an ESCAPE (HP Pascal/XL) or completing the trap handling procedure are the only valid ways to return.


MPE/iX 5.0 Documentation