Compiler Library/XL Reference Manual (32650-90029)
4- 15
Declaration
PROCEDURE HPPACSRD (
ANYVAR operand2 :decimal_type;
op2digs :INTEGER;
ANYVAR operand1 :decimal_type;
op1digs :INTEGER;
shift_amt :INTEGER;
VAR comparison_code :INTEGER;
VAR pacstatus :INTEGER;
OPTION
DEFAULT_PARMS (
comparison_code :=NIL,
pacstatus :=NIL)
UNCHECKABLE_ANYVAR;
EXTERNAL;
Comments
*
Operand1
is moved to the
operand2
field, with its digits offset to
the right relative to its sign, by the shift amount in the low-order
five bits of
shift_amt
.
* Digits shifted into the sign are lost.
* Zeros are shifted in from the left and high order zeros are inserted
to fill the
operand2
field, if necessary.
Possible Traps
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)
HPPACSUBD
HPPACSUBD performs decimal subtraction.
Declaration
PROCEDURE HPPACSUBD (
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
is subtracted from
operand2
and the difference is stored
into the
operand2
field.
* A decimal overflow occurs if the result digits do not fit in the
operand2
field. The left-truncated result is stored in
operand2
and
a trap occurs.
Possible Traps
Decimal overflow (1)
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)