Trap Handling Programmer's Guide 900 Series HP 3000 Computers ABCDE HP Part No. 32650-90026 Printed in U.S.A.
The information contained in this document is subject to change without notice. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance or use of this material.
Printing History New editions are complete revisions of the manual. Update packages, which are issued between editions, contain additional and replacement pages to be merged into the manual by the customer. The date on the title page and back cover of the manual changes only when a new edition is published. When an edition is reprinted, all the prior updates to the edition are incorporated. No information is incorporated into a reprinting unless it appears as a prior update.
Figure 0-1. =center width=6.5in height=3.
Figure 0-2. =center width=6.5in height=4.
Preface The Trap Handling Programmer's Guide explains how you can develop your own routines to handle interrupt events and thereby recover from errors and avoid a process abort. de nes traps and trap handling; summarizes trap handling on MPE XL. Chapter 1 Overview Chapter 2 MPE XL Arithmetic Traps Chapter 3 MPE XL Code-related Traps provides information regarding how the MPE XL trap subsystem handles code-related traps.
Conventions vii
NOTATION UPPERCASE DESCRIPTION Within syntax statements, characters in uppercase must be entered in exactly the order shown, though you can enter them in either uppercase or lowercase. For example: SHOWJOB Valid entries: showjob Invalid entries: shojwob SHOW_JOB italics ShowJob SHOWJOB ShoJob Within syntax statements, a word in italics represents a formal parameter or argument that you must replace with an actual value.
NOTATION [ ... ] DESCRIPTION Within syntax statements, a horizontal ellipsis enclosed in brackets indicates that you can repeatedly select elements that appear within the immediately preceding pair of brackets or braces. In the following example, you can select itemname and its delimiter zero or more times. Each instance of itemname must be preceded by a comma: [,itemname][ . . . ] If a punctuation character precedes the ellipsis, you must use that character as a delimiter to separate repeated elements.
NOTATION 4 The symbol 4 5 indicates a key on the terminal's keyboard. For example, 4CTRL5 indicates the Control key. 5 4CTRL5 DESCRIPTION char base pre xes char indicates a control character. For example, Y means you have to simultaneously press the Control key and the Y key on the keyboard. 4CTRL5 4CTRL5 The pre xes %, #, and $ specify the numerical base of the value that follows: %num speci es an octal number. #num speci es a decimal number. $num speci es a hexadecimal number.
Contents 1. Overview What are Traps? . . . . . . . . . . . . . What You See When a Trap Aborts a Process What is Trap Handling? . . . . . . . . . . MPE XL Trap Handling Intrinsics . . . . . Arithmetic Traps . . . . . . . . . . . . Software Library Traps . . . . . . . . . Software System Traps . . . . . . . . . CONTROL-Y Traps . . . . . . . . . . . Code-related Traps . . . . . . . . . . . Operating Mode Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Paragraph Stack Over ow Integer Over ow . . . . Decimal Over ow . . . . Invalid ASCII Digit . . . Invalid Decimal Digit . . Decimal Divide by Zero . IEEE Floating Point Traps 3000 Mode Traps . . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6. MPE XL Software System Traps XSYSTRAP . . . . . . . . . Syntax . . . . . . . . . . Parameters . . . . . . . . . Condition Codes . . . . . . Handling Software System Traps Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 6-2 6-2 6-2 6-3 6-4 A. MPE XL Trap Subsystem Escape Codes B.
Figures 0-1. 0-2. 1-1. 1-2. =center . . =center . . Example 1-1: Example 1-2: . . . . . . . . . . . . . . . . . . . . Minimal Stack Trace Full Stack Trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv v 1-2 1-2 . . . . . . . . . . . A-2 Tables A-1.
1 Overview The following paragaphs describe traps and trap handling routines. The discussion also introduces the concepts of enabling/disabling and arming/disarming traps. What are Traps? A trap involves the interruption, and possible termination, of a running process as the result of some event. Some events are detected in the hardware and, therefore, are known as hardware traps. Division by zero, result over ow, and data memory protection traps are examples of hardware traps.
a. If SETDUMP is not armed, then a minimal stack trace is printed, and the process is terminated. This stack trace contains all calls in which the destination (called) routine is in a di erent executable library. b. If SETDUMP is armed, the debugger is called with the SETDUMP command string. Depending on the cause of the abort, the debugger could be called again to allow interactive dialog.
What is Trap Handling? When a trap situation is detected and process execution is interrupted, control passes to the MPE XL trap subsystem, which determines what action is to be taken in response to the trap. In most instances, the trap subsystem outputs an appropriate error message and aborts the o ending process. Generally, this is what you want to happen.
There is a di erence 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 nvoked and can take appropriate recovery actions. The following list summarizes what can occur when an arithmetic trap condition arises: 1. If a trap is both enabled and armed, the user-written trap handler is invoked whenever a trap condition occurs. 2.
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 exibility in selectively enabling or disabling arithmetic traps.
Operating Mode Considerations A Native Mode (NM) trap handling routine often di ers from the corresponding Compatibility Mode (CM) 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 trap handler in order to run them on MPE XL.
2 MPE XL Arithmetic Traps There are two types of arithmetic traps: Hardware arithmetic traps Software arithmetic traps Each trap in the arithmetic trap set detects a particular type of arithmetic error, such as division by zero or result over ow. The user-written trap handler, if enabled and armed, receives an interrupt from the trap when an error is encountered, and control transfers to the user-written trap handling procedure.
The HPENBLTRAP intrinsic lets you selectively enable or disable speci c arithmetic traps. This intrinsic provides you with more exibility than the ARITRAP intrinsic. The XARITRAP intrinsic arms or disarms the user-written arithmetic trap handling procedure and enables/disables whatever traps that procedure accommodates. For some or all arithmetic traps, you can then replace the MPE XL software arithmetic trap handler with your own trap handling routine.
Paragraph Stack Over ow Discussions of the intrinsics follow. ARITRAP Collectively enables or disables arithmetic traps. Note When arithmetic traps are ignored (disabled) on MPE XL, the results are not guaranteed to be identical to those on MPE V/E. On MPE XL, a better way to disable arithmetic traps is to use compiler directives, for example, $ovflcheck off$ in HP Pascal/XL. When compiler directives are used, the compiler generates arithmetic instructions that do not trap on over ow.
Note By default, all traps except IEEE oating-point exceptions are enabled, and no trap is armed. Many oating-point operations result in an inexact result. Consequently, most compiler libraries doing oating-point operations will result in an inexact trap if the IEEE Inexact Result trap is enabled. Therefore, you should enable the IEEE Inexact Result trap (using the HPENBLTRAP intrinsic) only if absolutely necessary. Condition Codes CCE Request granted. The arithmetic traps were originally disabled.
Parameters mask 32-bit signed integer by value (required) A value determining which arithmetic traps are enabled and which are not. If a bit is on (=1), the corresponding trap is enabled. If a bit is o (=0), the corresponding trap is disabled. The bit and their associated arithmetic errors are as follows: Bit Trap Condition (31:1) 3000 Mode Floating Point Divide By Zero. (30:1) Integer Divide By Zero. (29:1) 3000 Mode Floating Point Under ow. (28:1) 3000 Mode Floating Point Over ow.
(12:1) (11:1) (10:1) (9:1) (8:1) (0:8) Note oldmask Range Errors. Software-detected NIL Pointer Reference. Software-detected Misaligned Result Of Pointer Arithmetic or Error In Conversion From Long Pointer To Short Pointer. Unimplemented Condition Traps. Paragraph Stack Over ow. Reserved. You should set these to 0. The following apply to the preceding trap conditions represented in the mask: 1. Native Mode supports two oating-point formats: IEEE and 3000 Mode.
Condition Codes CCE CCG CCL Request granted. All traps were originally disabled. Request granted. At least one trap was originally enabled. Not returned by this intrinsic. XARITRAP Arms or disarms the user-written arithmetic trap handling procedure. Although you can arm the trap for any desired combination of events, at any given time there is only one user-written trap handler for all armed traps. Note By default, all traps except IEEE oating-point exceptions are enabled, and no trap is armed.
disarmed. The bits and their associated arithmetic errors are as follows: Bit Trap Condition (31:1) 3000 Mode Floating Point Divide By Zero. (30:1) Integer Divide By Zero. (29:1) 3000 Mode Floating Point Under ow. (28:1) 3000 Mode Floating Point Over ow. (27:1) Integer Over ow. (26:1) 3000 Mode Double Precision Over ow. (25:1) 3000 Mode Double Precision Under ow. (24:1) 3000 Mode Double Precision Divide By Zero. (23:1) Decimal Over ow. (22:1) Invalid ASCII Digit. (21:1) Invalid Decimal Digit.
(9:1) (8:1) (0:8) Note Unimplemented Condition Traps. Paragraph Stack Over ow. Reserved. You should set these to 0. The following apply to the preceding trap conditions represented in the mask: 1. Native Mode supports two oating-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. 2.
Returns the plabel of your process' previous arithmetic trap handler. If no plabel was previously con gured, oldplabel returns 0 (indicating the MPE XL trap subsystem was in e ect). Condition Codes CCE CCG CCL Request granted. The desired traps are now armed. Request granted. All traps are now disarmed. Not returned by this intrinsic. Caution CCL is de ned di erently on MPE V/E systems.
bits are described in the discussion of the mask parameter of the XARITRAP intrinsic. Note If two exceptions occur simultaneously, the error-code is the inclusive-OR of the error-code for each exception. The only exceptions that coincide are IEEE inexact with IEEE over ow, and IEEE inexact with IEEE under ow. The following paragraphs describe the contents of this record structure for the various arithmetic trap conditions.
Range Errors The record structure for a trap condition resulting from a range error is as follows: 0 4 8 12 |--------------------------------| | instruction | |--------------------------------| | offset | |--------------------------------| | space_id | |--------------------------------| | error_code | |--------------------------------| Corrective action for this trap condition is not supported. You can allow execution to resume, but the result will be unpredictable.
Pointer Arithmetic Errors The record structure for a trap condition resulting from a pointer arithmetic error is as follows: 0 |--------------------------------| | instruction | 4 |--------------------------------| | offset | 8 |--------------------------------| | space_id | 12 |--------------------------------| | error_code | |--------------------------------| Corrective action for this trap condition is not supported. You can allow execution to resume, but the result will be unpredictable.
Integer Overflow The record structure for a trap condition resulting from an integer over ow is as follows: 0 4 8 12 16 |--------------------------------| | instruction | |--------------------------------| | offset | |--------------------------------| | space_id | |--------------------------------| | error_code | |--------------------------------| | subcode | |--------------------------------| The subcode eld is a 32-bit integer that tells what type of integer over ow has occurred.
| offset | 8 |--------------------------------| | space_id | 12 |--------------------------------| | error_code | 16 |--------------------------------| | subcode | |--------------------------------| The subcode eld is a 32-bit integer that tells what type of decimal over ow has occurred.
|--------------------------------| The subcode eld can assume the following values with the associated meanings: 0 There is an illegal digit and/or sign. 1 The number is not signed. 2 The input number on an unsigned-to-unsigned operation is signed. 3 The input number on an unsigned-to-signed operation is signed. The source_address and digit_count record leds supply the following information: Address of the rst digit (32-bit address). Digit count (32-bit integer) is the number of bytes.
| source_address | 24 |--------------------------------| | digit_count | |--------------------------------| The subcode eld can assume the following values with the associated meanings: 0 There is an illegal digit and/or sign. 1 The number is not signed. 2 The input number on an unsigned-to-unsigned operation is signed. 3 The input number on an unsigned-to-signed operation is signed. The source_address and digit_count record elds supply the following information: Address of the rst digit (32-bit address).
12 16 20 |--------------------------------| | error_code | |--------------------------------| | result address | |--------------------------------| | digit count | |--------------------------------| The result_address and digit_count record elds supply the following information: Address of the result (32-bit address) Number of digits in the result (32-bit integer) With this information, you can assign the desired value to the result, and allow execution to resume with the operation following the division.
20 |--------------------------------| | operation | 24 |--------------------------------| | format | 28 |--------------------------------| | source_op1_ptr | 32 |--------------------------------| | source_op2_ptr | 36 |--------------------------------| | result_ptr | |--------------------------------| The following table explains the information supplied in the additional record elds associated with IEEE traps: status 32-bit integer Value of the status register of the IEEE corprocessor.
09 10 CNVXF CMP The value of the operation record eld is formed by extracting the OP and CLASS elds from the instruction that caused the trap. The instruction appears as follows: Note 0 format 26 27 28 29 31 |---------------------------|------|------| | all zeros |Class | OP | |---------------------------|------|------| 32-bit integer Indicates whether the operation that caused the trap had 32-bit, 64-bit, or 128-bit operands.
12 13 the The the The the result source result source result is is is is is 64-bit. 32-bit; 128-bit. 64-bit; 128-bit. source_op1_ptr32-bit address Address of the rst operand. This operand can be a 32-bit, 64-bit, or 128-bit oating-point number depending upon the operation and format. The address is properly aligned, with 32-bit items on a word boundary, and 64-bit and larger items on a double-word boundary. source_op2_ptr32-bit address Address of the second operand.
3000 Mode Floating Point Divide By Zero 3000 Mode Floating Point Over ow 3000 Mode Floating Point Under ow The record structure for a 3000 Mode trap condition is as follows: 0 4 8 12 16 |--------------------------------| | instruction | |--------------------------------| | offset | |--------------------------------| | space_id | |--------------------------------| | error_code | |--------------------------------| | result_ptr | |--------------------------------| The result_ptr record eld is a 32-bit addres
Caution A user-de ned 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.
TYPE real_ptr long_ptr = ^real; = ^longreal; user_info_rec = record instruction : integer; offset : integer; space_id : integer; error_code : integer; status : integer; operation : integer; format : integer; source1_ptr : localanyptr; source2_ptr : localanyptr; result_ptr : localanyptr; end; (* record *) user_info_ptr = ^user_info_rec; (* Constants for the trap procedure *) CONST (* mask for trapping all ieee exceptions *) ieee_mask = hex('0007C000'); (* error code for divide by zero *) fdiv_zero = hex('0
PROCEDURE ARITRAP; intrinsic; PROCEDURE XARITRAP; intrinsic; Example 2-1 Arithmetic Trap Handler, continued (* Trap handling routine *) PROCEDURE Trap_Handler(user_info : user_info_ptr); VAR long_res_ptr : long_ptr; real_res_ptr : real_ptr; BEGIN (* Handle only divide by zero; ignore all others *) With user_info^ do if ( error_code = fdiv_zero ) then BEGIN (* Change the value of the result *) END; if ( format = 0 ) then BEGIN real_res_ptr := result_ptr; real_res_ptr^ := maxreal; END else if ( format =
BEGIN ARITRAP(1); (* enable all traps *) XARITRAP( ieee_mask, baddress( Trap_Handler), oldmask, oldplabel); (* arm all ieee traps *) L1 := 233.0; L2 := 0.0; L3 := L1/L2; (* ieee divide by zero *) (* The following statement is executed upon return from *) (* the trap handler; the value of L3 is maxlongreal *) writeln(L3); END.
3 MPE XL Code-related Traps Code-related traps result from illegal or erroneous coding.
4 MPE XL CONTROL-Y Traps If you are running a program in an interactive session, you can arm a special trap that transfers control in the program to a trap handling procedure whenever a subsystem break signal is entered from the session terminal. On most terminals, you transmit the subsystem break signal by pressing the 4CTRL5 Y key. To do this, press the 4Y5 key while holding down the 4CTRL5 key. For this reason, subsystem break traps are commonly called CONTROL-Y traps.
previously armed a CONTROL-Y trap handler with the XCONTRAP intrinsic. After your CONTROL-Y trap handler has been invoked, you should call RESETCONTROL when you are ready to receive another subsystem break signal. RESETCONTROL can be called from within the CONTROL-Y trap handler, or from any other procedure. Note Once your process has received a subsystem break signal, only a call to RESETCONTROL allows it to receive another such signal. Calling XCONTRAP again does not have this e ect.
oldplabel 1. Obtain the 16-bit external CM plabel of your CM CONTROL-Y trap handler. One way to do this is by using the LOADPROC intrinsic. 2. Pass this 16-bit plabel in the following 32-bit format: Bits Setting (0:16) 16-bit external CM plabel. (16:13) Reserved. Set to zero. (29:1) Set to 1. (30:1) Set to 0. (31:1) Set to 1. 32-bit signed integer passed by reference (required) Returns the plabel of your process' previous CONTROL-Y trap handler.
RESET CONTROL Allows a process to accept another CONTROL-Y signal. Syntax The RESETCONTROL intrinsic is called as follows: RESETCONTROL; Parameters None. Condition Codes CCE CCG CCL Request granted. Not returned by this intrinsic. Request denied because the trap procedure was not invoked. Handling CONTROL-Y Traps When more than one process is currently running within your process tree structure, the CONTROL-Y signal interrupts the last process to arm the trap.
a. If the interrupted program or procedure was waiting for completion of input/output (reading from or writing to the terminal) when the CONTROL-Y signal was received, the program continues execution immediately after the FREAD or FWRITE call. These intrinsics will indicate successful completion. b. If the CONTROL-Y signal was received during reading, the number of characters typed in before this signal is returned to you as the value of FREAD. The \carriage" position is unchanged.
Performing an ESCAPE (HP Pascal/XL) or completing the trap handling procedure are the only valid ways to return.
5 MPE XL Software Library Traps The software library trap reacts to errors that occur during execution of procedures from the compiler libraries. You can arm or disarm the user-written software library trap handing procedure by calling the XLIBTRAP intrinsic. When a program begins execution, the user-written subsequently library trap hander is disarmed automatically. If armed by the XLIBTRAP intrinsic, and subsequently activated by an error, the user-written software library trap handler executes.
XLIBTRAP Arms or disarms the user-written software library trap handling procedure. Syntax The XLIBTRAP intrinsic is called as follows: XLIBTRAP(plabel,oldplabel); Parameters plabel 32-bit signed integer passed by value (required) oldplabel The address of your trap handling procedure. If the value of plabel is 0, the trap handler is disarmed. 32-bit signed integer passed by reference (required) Returns the plabel of your process' previous software library trap handler.
Handling Software Library Traps The subsequent paragraphs discuss issues relevant to the task of handling software library traps, as follows: Parameters of the library trap handler Escape from the library trap handler Failing to arm the library trap handler Calling the XLIBTRAP intrinsic Parameters The user-written software library trap handler has the following three parameters: Information-pointer Error-code Abort ag Information-pointer The information-pointer parameter is a pointer to a record that co
|-----------------------------------| | SPACE ID of procedure | |-----------------------------------| | OFFSET of procedure | |-----------------------------------| | SP (stack pointer) of procedure | |-----------------------------------| | DP (data pointer) of procedure | |-----------------------------------| These elds describe the environment of the procedure that called the library routine. For more information on the information-pointer record, refer to the appropriate language reference manual.
error message (just as if no trap handling procedure had been executed). If abort-flag is set to 0, the compiler library does not abort your program, and no error message is printed. Processing continues with the result as modi ed by your trap handling procedure. Escaping the Library Trap Handler The library trap handler can execute an ESCAPE if you have previously executed an HP Pascal/XL TRY statement. Execution resumes with your RECOVER block.
You do not need to modify existing CM applications that use a library 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 library traps. Caution A user-de ned trap handling procedure cannot perform a goto out of that procedure.
TYPE Pstmrk = record user_SpaceID, user_Offset, user_StackPointer, user_DataPointer : integer; end; (* record *) VAR Paserr_CloseError : integer; oldplabel : integer; PROCEDURE XLIBTRAP; intrinsic; Example 5-1 Software Library Trap Handler, continued PROCEDURE My_Library_Trap_Handler ( Var info_rec : Pstmrk; Var errorcode : integer; Var abortflag : integer); BEGIN (* ignore file close errors *) if ( errorcode = Paserr_CloseError ) then BEGIN writeln ('File close error, continue execution'); abortflag :=
XLIBTRAP( baddress(My_Library_Trap_Handler), oldplabel); (* remainder of program *) END.
6 MPE XL Software System Traps A software system trap is a software-detected error that occurs while system code (typically a system intrinsic) is executing. These traps result in the calling process being aborted. You can intercept system traps by supplying and arming a system trap handling routine. This trap handler can obtain information about the error and prevent the process from being aborted. Some intrinsics are designed to abort the calling process when certain errors are detected.
XSYSTRAP Arms or disarms the user-written system trap handling procedure. Syntax The XSYSTRAP intrinsic is called as follows: XSYSTRAP(plabel,oldplabel); Parameters plabel 32-bit signed integer passed by value (required) oldplabel The address of your trap handling procedure. If the value of plabel is 0, the software trap handler is disarmed. 32-bit signed integer passed by reference (required) Returns the plabel of your process' previous software system trap handler.
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 intrinsicnum A constant value that is useful when the same trap handler is used to handle di erent types of system traps. 32-bit signed integer passed by value A unique intrinsic identi er (ID). intrinsicerr See Appendix C for a complete list of intrinsic numbers.
Caution A user-de ned 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.
{ This is the trap handling routine that will be invoked } { once a system trap occurs. } begin writeln writeln writeln writeln writeln writeln (output, 'Now in the trap handling routine.'); (output); (output, 'Trap code = ', trap_code); (output, 'Intrinsic number = ', intrin_num); (output, 'Error = ', intrin_error); (output, 'Parameter = ', intrin_parm); end; {sys_trap_procedure} procedure arm_systrap_routine; { This routine calls XSYSTRAP with the plabel of the { preceding system trap handling routine.
{ When sys_trap_procedure exits, control should } { return to the statement following the call to the } { ACTIVATE intrinsic, which is a writeln statement. } arm_systrap_routine; activate (0,0); {invalid ACTIVATE call } writeln (output, 'Now back in the program outer block.'); end.
A MPE XL Trap Subsystem Escape Codes The escape codes from the trap library are 32-bit integer values that are read in two 16-bit elds: +----------------+----------------+ | Error Number | Subsystem | +----------------+----------------+ Bit 0 15 16 31 Bits (0:16) comprise ecode.errnum . Bits (16:16) comprise ecode.subsys . The subsystem number for the MPE XL trap subsystem is 200. The values of ecode.
Table A-1.
Table A-1 Trap Library Escape Codes (Page 2) Error Number Escapecode in Hex 15 0x000f00c8 IEEE Floating Point Over ow 14 0x000e00c8 IEEE Floating Point Divide by Zero 13 0x000d00c8 IEEE Floating Point Invalid Operation 12 0x000c00c8 Range Errors 11 0x000b00c8 Software-detected Nil Pointer Reference 10 0x000a00c8 Software-detected Misaligned Pointer or Conversion of Long Pointer into Short Pointer Error 09 0x000900c8 Unimplemented Condition Trap 08 0x000800c8 Paragraph Stack Over ow
B Intrinsic Numbers One of the parameters passed to a user-de ned system trap handling routine is the number of the intrinsic that caused the trap. The following lists the system intrinsics and their associated numbers. In some instances, no number is assigned. This occurs when the intrinsic cannot cause an abort.
Intrinsic Name Intrinsic Number ABORTSESS 196 ACTIVATE 104 ADJUSTUSLF 83 ALMANAC 406 ALTDSEG 134 ARITRAP 51 ASCII 63 BEGINLOG 216 BINARY 62 CALENDAR 43 CATCLOSE 417 CATOPEN 415 CATREAD 416 CAUSEBREAK 56 CLEANUSL 88 CLOCK 44 CLOSELOG 212 COMMAND 68 CREATE 100 CREATEPROCESS 101 CTRANSLATE 61 DASCII 75 DATELINE 89 DBINARY 74 DEBUG 99 DLSIZE 135 DMOVIN 132 DMOVOUT 133 ENDLOG 217 EXPANDUSLF Intrinsic B-2 FATHER Numbers 84 109 FCHECK 10 FCLOSE 8
Intrinsic Name Intrinsic Number FINDJCW 86 FINTEXIT 23 FINTSTATE 24 FLABELINFO 25 FLOCK 15 FLUSHLOG 213 FMTCALENDAR 90 FMTCLOCK 91 FMTDATE 92 FOPEN 1 FPARSE 312 FPOINT 6 FREAD 2 FREADBACKWARD 39 FREADDIR 7 FREADLABEL 19 FREADSEEK 12 FREEDSEG 131 FREELOCRIN 31 FRELATE 18 FRENAME 17 FSETMODE 14 FSPACE 5 FUNLOCK 16 FUPDATE 4 FWRITE 3 FWRITEDIR 8 FWRITELABEL 20 GENMESSAGE No number assigned.
Intrinsic Name Intrinsic Number HPSETCCODE No number assigned. HPSETDUMP No number assigned. HPSWITCHTOCM No number assigned. HPUNLOADCMPROCEDURE No number assigned.
Intrinsic Name Intrinsic Number TIMER 40 SUSPEND 103 TERMINATE 60 UNLOADPROC 81 UNLOCKGLORIN 35 UNLOCKLOCRIN 33 WHO 69 WRITELOG 211 XARITRAP 50 XCONTRAP 54 XLIBTRAP 52 XSYSTRAP 53 ZSIZE 136 Intrinsic Numbers B-5