HP Pascal/iX Programmer's Guide (31502-90023)

11- 14
you perform will cause this trap to be raised.
To disable your Arithmetic Trap Handler, pass zero to XARITRAP as the
second parameter.
For the following traps, the system trap handler passes your Arithmetic
Trap Handler more fields than the four defined above in the
TrapInfo
record, and you must adjust
TrapInfo
accordingly.
Integer overflow trap
Decimal overflow trap
Invalid ASCII digit trap
Invalid decimal digit trap
IEEE floating-point traps
Compatibility Mode floating-point traps
The following sections describe the extra parameters.
Integer Overflow Trap.
The
TrapInfo
record must have one extra field,
SubCode
.
SubCode
(word
#5) contains one of the following codes, which tells what kind of integer
overflow occurred.
SubCode Type of Overflow
Value
1 32/64-bit overflow
2 16-bit overflow
3 8-bit overflow
4 overflow on conversion from a compatibility-mode
floating-point number
5 overflow on conversion from an IEEE floating-point number
Decimal Overflow Trap.
The
TrapInfo
record must have one extra field,
SubCode
.
SubCode
(word #5) contains one of the following codes, which tells what
kind of decimal overflow occurred.
Subcode Type of Overflow
Value
1 overflow in decimal arithmetic operation
2 overflow in conversion from ASCII to decimal
Invalid ASCII Digit and Invalid Decimal Digit.
The
TrapInfo
record has three extra fields:
1.
Subcode
(word #5) contains a code 0..3. Refer to the
Trap
Handling Programmer's Guide
for more information.
2.
Address
(word #6) contains the address of the first digit of the
number
3.
Count
(word #7) contains the digit count
IEEE Floating Point Traps.
The
TrapInfo
record has six extra fields: