# Decimal Multiply (Mp) - RCA Spectra 70 Training Manual

System
Also See for Spectra 70:

If an attempt were made to add the amount to the
balance with the following instruction:
ASSEMBLY
OPERATION
OPERAND
INSTRUCTION
~---------4------------~
AP
BAL (3), AMT (5)
~!~~~~~~gN
1 FA1612 141110 13000101110 13020101
General Register one contains
0000
the result in the balance BALwould be as follows and
the Condition Code would be set as indicated.
EXAMPLE 1 RESULT
BAL
1
30
I
~~ ~~ ~
{
CC
=
2 (pOSITIVE RESULT)
EXAMPLE 2 RESULT
BAL
I
30
I
~~ ~~ ~! ~
CC
=
3 (OVERFLOW)
Note that in Example 2, the Condition Code of 3
(overflow) is not an indication that truncation has
occurred as truncation also has occurred in Example
1. The overflow setting is based on the 1 carry from
the MSD of the Result field.
There is no hardware check or error indication for
invalid or incorrectly addressed fields.
It
is the re-
sponsibility of the programmer to be sure that he
has addressed valid packed fields.
A field may be added to (or subtracted from) itself
if desired.
As an example, assume that a field has been used
for accumulation and it is desired to zero fill it with
a valid sign in the rightmost byte position.
The
field WBAL is as follows:
61
WBAL
43
44
45
46 )
02
15
24
3+
)
The following instruction would zero fill and pre-
serve the sign pOSition:
ASSEMBLY
OPERATION
OPERAND
INSTRUCTION
SP
WBAL(4). WBAL(4)
GENERATED
INSTRUCTION
General Register two contains 4096 10
30
RESULT
FIELD
WBAL
43
44
45
46
61
t - - - - - - - - - - - {
00
00
00
0+
MULTIPLY DECIMAL
Multiplication may be performed on two packed oper-
ands. The result (product) replaces the first oper-
and (multiplicand) following execution of the instruc-
tion.
The number of leading zeros in the multiplicand
should equal the number of significant digits in the
multiplier. If the multiplicand field has an insuf-
ficient number of leading zeros, the high-order
product digits are truncated.
The programmer must ensure that fields are valid
numerics as the hardware performs no check of this
type.
The Condition Code is not affected by the exe-
cution of this instruction.
Example
#J
In this example assume the two fields are present in
memory and have been assigned the following values:
PRCE
07
08
21
21
57
09
22
2+
NUNT
30
31
02\7+
The item PRCE, to be multiplied by NUNT, is not
of sufficient length to receive the product.
It
could
be moved to a zero-filled work area and multiplica-
tion performed as follows:
HSM BEFORE
EXECUTION
HSM BEFORE
AND AFTER
EXECUTION
ASSEMBLY
INSTRUCTION
WPRC
OPERATION
OPERAND
MP
WPRC(5) ,NUNT (2)
~:s~~~~~~gN
I
FC 16 1410 1110 I
Z
10 I
zo0
10
1
210
IZ30 lO
I
GENERAL REGISTf;R 1 CONTAINS Z00010
HSM AFTER
EXECUTION