Xerox Sigma 6 Reference Manual page 65

Table of Contents

Advertisement

2
3
o
o
o
4
Result of DST
all significant in_j
formation stored
some significant
information not
stored
no illegal digit or
illegal sign detec-
ted, i nstructi on
completed
OA
DECIMAL ADD
(Byte index
01
ignment)
If
no i II ega I di git or sign is detected in the effecti ve dec i-
mal operand or in the decimal accumulator, DECIMAL ADD
expands the effective decimal operand to 16 bytes (31 digits
plus sign) by
appE~nding
high-order O's, algebraically adds
the expanded decimal number to the contents of the entire
decimal accumulator, and then loads the sum into the deci-
mal accumulator.
If the result in the decimal accumulator
is zero, the resulting sign is forced to the positive form.
Overflow occursifthesum exceeds thecapacityof the deci-
mal accumulator (i. e. , if the absolute value of the sum is equal
to or greater than 10 31 ), inwhich case CC1 is reset to 0, CC2
is set to 1, and the instruction aborted with the previous con-
tents of the decimal accumulator, CC3 and CC4 unchanged.
Affected: (DECA), CC
(DECA) + EDO -
DECA
Traps: Decimal arithmetic
Condition code settings:
2
3
4
Result in DECA
0
illegal digit or
sign detected
instruction aborted
0
overflow
0
0
0
0
zero
)
no illegal digit or sign
0
0
0
negative
detected, no overflow,
0
0
0
positive
instruction completed
OS
DECIMAL SUBTRACT
(Byte index
01
ignment)
If no illegal digit or sign is detected in the effective deci-
mal operand or in the decimal accumulator, DECIMAL SUB-
TRACT expands the effective decimal operand to 16 bytes
(31 digits plus sign) by appending high-order O's, alge-
braically subtracts the expanded decimal number from the con-
tents of the entire decimal accumulaTor, and then loads the
difference into the decimal accumulator. If the result in the
decimal accumulator is zero, the resulting sign is forced to
the positive form.
Overfl ow occurs if the <:Ji fference exceeds the capac i ty of
the decimal accumulator (i.e., if the absolute value of the
difference is equal to or greater then 10 31 ), in which case
CCl is reset to 0, CC2 is set to 1, and the instruction is
aborted with the contents of the previous decimal accumu-
lator, CC3 and CC4 unchanged.
Affected: (DECA), CC
Traps: Decimal arithmetic
(DECA) - EDO - - DEC A
Condition code settings:
2
3
4
Result in DECA
0
illegal digit or
sign detected
i nstructi on aborted
a
overflow
a a a a
zero
} no illegal digit or sign de-
a a a
negative
tected, no overflow, in-
a a
0
positive
struction completed
OM
DECIMAL MU L TIPL Y
(Byte index
01
ignment, continue after interrupt)
If
no illegal digit or sign is detected in the effective dec i-
mal operand and there is at least one decimal sign in the
decimal accumulator, DECIMAL MULTIPLY multiplies the
effective decimal operand (multiplicand) by the entire
contents of the decimal
accumu~ator
(multiplier) and then
loads
th~
product into the decimal accumulator.
If
the
result in the decimal accumulator is zero, the resulting
sign is forced to the positive form.
No overflow can occur;
how~ver,
an indeterminate result
occurs (with an incorrect condition code indication, and
with no trap activation) if any of the following conditions
are not satisfied before the initial execution of DECIMAL
MULTIPLY:
1.
The 4 low-order bit positions of the decimal accumu-
lator must contain the sign of the multiplier.
2.
The 16 high-order digit positions of the decimal accu-
mulator (i .e., general registers 12 and 13) must contain
all O's.
3.
The effective decimal operand must not exceed 15 deci-
mal digits
(i.
e., the value of L must not exceed 8).
This instruction can be interrupted during the course of its
exec;ution, and then be resumed, without producing an er-
roneous product (provided that the contents of the decimal
accumulator are not altered between the interruption and
continuation).
Actually, the instruction is reexecuted,
but since there is no initializing phase, it begins with the
same iteration that was started prior to the interrupt.
Affected: (DECA), CC
(DECA) x EDO -
DECA
Condition code settings:
Traps: Decimal arithmetic
2 3 4
Result in DECA
illegal digit or sign detected, instruc-
tion aborted
Decimal Instructions
57

Advertisement

Table of Contents
loading

Table of Contents