Compiler Library/XL Reference Manual (32650-90029)

4- 7
is passed by value.
NOTE The packed-decimal procedures do not alter the condition code
associated with the process.
Procedure Declarations
The procedure declarations in this chapter assume the following Pascal
directives and declarations.
$STANDARD_LEVEL 'EXT_MODCAL'$
$UPPERCASE ON$
$TYPE
ascii_type = $ALIGNMENT 1$ RECORD END;
binary_type = $ALIGNMENT 2$ RECORD END;
decimal_type = $ALIGNMENT 1$ RECORD END;
In the listings of possible traps, the numbers in parentheses are the
trap subcodes supplied to the user when a trap handler has been armed, as
explained under "Trap Handling" (above). If traps have been disabled,
these are the codes returned to the caller through the
pacstatus
parameter.
HPPACADDD
The HPPACADDD procedure adds two operands and stores the result.
Declaration
PROCEDURE HPPACADDD (
ANYVAR operand2 :decimal_type;
op2digs :INTEGER;
ANYVAR operand1 :decimal_type;
op1digs :INTEGER;
VAR comparison_code :INTEGER;
VAR pacstatus :INTEGER)
OPTION
DEFAULT_PARMS (
comparison_code :=NIL,
pacstatus :=NIL)
UNCHECKABLE_ANYVAR;
EXTERNAL;
Comments
Operand1
and
operand2
are added and the sum is stored into the
operand2
field. A decimal overflow occurs if all significant digits of the result
do not fit in the
operand2
field. This results in a trap, and the
left-truncated result is stored in the
operand2
field.
Possible Traps
Decimal overflow (1)
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)
HPPACCMPD
HPPACCMPD compares two decimal operands and sets a condition code.
PROCEDURE HPPACCMPD (
ANYVAR operand1 :decimal_type;
op1digs :INTEGER;
ANYVAR operand2 :decimal_type;