Compiler Library/XL Reference Manual (32650-90029)
4-: 14
Comments
*
Operand1
is moved to the
operand2
field with its digits offset by the
shift amount in the low-order five bits of
shift_amt
.
* Leading or trailing digits in the result field that are not supplied
by the source operand will be zeros.
* If the shift amount is large enough that significant digits of
operand1
would be shifted out of the
operand2
field, the effective
shift amount is reduced so
operand1
is left-justified in the
operand2
field. In addition, a number equal to the difference between the
specified and actual shifts amounts is left in
shift_amt
, and
carry
is set to one.
* If the length of the
operand2
field is such that significant digits
would be lost even with a shift amount of zero, a decimal overflow
trap occurs, and no data movement occurs.
Possible Traps
Decimal overflow (1)
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)
HPPACSLD
HPPACSLD performs a decimal left shift.
Declaration
PROCEDURE HPPACSLD (
ANYVAR operand2 :decimal_type;
op2digs :INTEGER;
ANYVAR operand1 :decimal_type;
op1digs :INTEGER;
shift_amt :INTEGER;
VAR comparison_code :INTEGER;
VAR pacstatus :INTEGER;
VAR carry :INTEGER)
OPTION
DEFAULT_PARMS (
comparison_code :=NIL,
pacstatus :=NIL,
carry :=NIL)
UNCHECKABLE_ANYVAR;
EXTERNAL;
Comments
*
Operand1
is moved to the
operand2
field with its digits offset to the
left of its sign by the shift amount in the low-order five bits of
shift_amt
.
* Leading or trailing digits in the result field that are not supplied
by the source operand will be zeros.
* Digits shifted out of the
operand2
field are lost, and
carry
is set
to one to indicate that significant digits were lost.
Possible Traps
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)
HPPACSRD
HPPACSRD performs a decimal right shift.