Download Print this page

IBM 4300 Manual page 283

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

Advertisement

ZERO AND ADD (ZAP)
Assume that the signed, packed-decimal number at
storage locations 4500-4502 is to be moved to
locations 4000-4004 with four leading zeros in the
result field. Also assume:
Register 9 contains 00 00 40 00.
Storage locations 4000-4004 contain 12 34 56 78 90.
Storage locations 4500-4502 contain 38 46 00.
After the instruction: \
Machine Format
Op Code
F8
4
2
9
I
0001
Assembler Format
Op Code
01(Ll,B1),02(L2,B2)
ZAP
0(S,9),X'SOO'(3,9)
9
I
500
1
is executed, the storage locations 4000-4004
contain 00 00 38 46 OD; condition code 1 is set to
indicate a negative result.
Note that, because the first operand is not
checked for valid sign and digit codes, it may
contain any combination of hexadecimal digits
before the operation.
Floating-Point Instructions
(See Chapter 9.)
In this section, the abbreviations FPRO, FPR2,
FPR4, and FPR6 stand for floating-point registers
0, 2, 4, and 6 respectively.
ADD NORMALIZED (AD, ADR,AE,
AER, AXR)
The ADD NORMALIZED instructions perform the
addition of two floating-point numbers and place
the normalized result in a floating-point register.
Neither of the two numbers to be added must
necessarily be normalized before addition occurs.
For example, assume that:
FPR6 contains C3 08 21 0000000000
==
-82.116
==
-130.0610 approximately
(unnor~alized).
Storage locations 2000-2007 contam 41 12 34 56 00 00 00
00
=
+
1.2345616
=
+
1.1410 (normalized).
Register 13 contains 00 00 20 00.
The instruction:
Machine Format
Op Code
R1
X2
B2
02
7A
6
0
0
I
0001
A-30
IBM 4300 Processors Principles of Operation
Assembler Format
Op Code
R1,02(X2,B2)
AE
6,0(0,13)
performs the short-precision addition of the two
operands, as follows.
The characteristics of the two numbers (43 and
41) are compared. Since the number in storage has
a characteristic that is smaller by 2, it is
right-shifted two hexadecimal digit positions. The
two numbers are then added:
FPR6:
--43 08 21 00
Shifted no. from storage: +43
00
12 34
5
Intermediate sum:
1Guard digit
-43
08 OE
CB
B
Because the intermediate sum is unnormalized, it
is left-shifted to form the normalized floating-point
number -42 80 EC BB
=
-80.ECBB
16
=
-128.92.
Combining the sign with the characteristic, the
result is C2 80 EC BB, which replaces the left half
of FPR6. The right half of FPR6 and the contents
of storage locations 2000-2007 are unchanged.
Condition code 1 is set to indicate a negative
result.
If
the long-precision instruction AD is used, the
result in FPR6 is C2 80 EC BA AO 00 00 00.
Note that the long-precision instruction avoids a
loss of precision in this example.
ADD UNNORMALIZED (A
U,
A
UR,A~
AWR)
The ADD UNNORMALIZED instructions operate
identically to the ADD NORMALIZED
instructions, except that the final result is not
normalized. For example, using the the same
operands as in the example for ADD
NORMALIZED, when the short-precision
instruction:
Machine Format
Op Code
R1
X2
B2
02
7E
6
0
0
I
0001
Assembler Format
Op Code
Rl,02(X2,B2)
AU
6,0(0,13)

Advertisement

loading