Download Print this page

IBM 4300 Manual page 281

Processors principles of operation for ecps: vse mode
Hide thumbs Also See for 4300:

Advertisement

produce the following results for the two examples
under EDIT:
Pattern
1000
100C
1401SBIF2.16BIFSIF71F414BIF21F61401401401
b
$
2
S
7
4
This pattern field prints as:
$2,574.26
2 6 b b b
Condition code 2 is set to indicate that the
number edited was greater than zero.
Pattern
1000
100C
b b b b b $ 0
2
6
b
C R
This pattern field prints as:
$0.26 CR
Condition code 1 is set because the number is
less than zero.
MULTIPLY DECIMAL (MP)
Assume that the signed, packed-decimal number in
storage locations 1202-1204 (the multiplicand) is
to be multiplied by the signed, packed-decimal
number in locations 500-501 (the multiplier).
1202
1204
Multiplicand 138146\001
SOO SOl
Mu
1
tip
1
i er
~
Because the multiplier and multiplicand have a
total of eight significant digits, at least five bytes
must be reserved for the signed result. ZERO
AND ADD can be used to move the multiplicand
into a longer field. Assume:
Register 4 contains 00 00 12 00.
Register 6 contains 0000 05 00.
Then execution of the instruction:
ZAP X'100'(5,4),2(3,4)
sets up a new multiplicand in storage locations
1300-1304:
A-28
IBM 4300 Processors Principles of Operation
1300
1304
Multiplicand (new) 1001001381461001
Now, after the instruction:
Machine Format
Op Code
FC
4
Assembler Format
Op Code
01(Ll,Bl),02(L2,B2)
MP
X'100'(S,4),0(2,6)
6 1 0001
is executed, storage locations 1300-1304 contain
the product:
01 23 45 66 OC.
SHIFT AND ROUND DECIMAL (SRP)
The SHIFT AND ROUND DECIMAL (SRP)
instruction can be used for shifting decimal
numbers in storage to the left or right. When a
number is shifted right, rounding can also be done.
Decimal Left Shift
In this example, the contents of storage location
FIELD 1 are shifted three places to the left,
effectively multiplying the contents of FIELD 1 by
1000. FIELD1 is six bytes long. The following
instruction performs the operation:
Machine Format
Op Code
Ll
FO
S
o
1****1
0 1 003 1
Assembler Format
Op Code
Sl(Ll),S2,13
SRP
FIEL01(6),3,0
FIELOl (before):
00 01 23 4S 67
BC
FIELOl (after):
12 34 S6 78 00 OC
The second -operand address in this instruction
specifies the
~hift
amount (three places). The
rounding factor, 13, is not used in left shift, but it

Advertisement

loading