Case 3: Register 3 contains FF FF FF FD
If the scale factor is -3, FIELD4 represents
127 x10..,3 = 0.127 FIELD4 (after): 00 00 00 01 3C
The implied decimal point isnow shifted two places
to the left; because the shift was to the righi.
FIELD4 is rounded to the nearest two deciinal
places.
In the preceding cases, the implied decimal is shifted two
places to the left, under control ofthe D2 field in the SRP instruction. The shifting is controlled by the address that is
resolved when the contentsof the base register (GR 3) are
added to the displacement D2, effecting the multiplication
of FIELD4 by a variablepower of 10. Zero and Add (ZAP)
Assume that the signed, packed-decimal field at storagelo cations 45004502 is to be moved to locations 4000-4004 with four leading zeros in the result field. Also assume:
Register 9 contains00 00 40 00 Storage locations 4000-4004 contaIn 12 34 56 78 90 Storage locations 4500-4502 contain 38 46 OD After the instruction
Machine Format
F8I 4 I 2 I 9 000 500 Assembler Format Op Code 01 (L1, 8,)' 02 (L2' 82) ZAP 0(5,9),X'500'(3,9) is executed, the storage locations 4000-4004 contain 0000 3846 OD; condition code 1 is set to indicate a negative re sult. Note that because the first operand is not checked for
valid sign and digit codes, it may contain any combination
of hexadecimal digits.FLOATING-POINT INSTRUCTIONS In this section, the abbreviations FPRO, FPR2, FPR4, and FPR6 stand for floating-point registers 0, 2,4, and 6,
respectively.
Add Normalized (AE, AER, AD, ADR)
The ADDNORMALIZED instructio.ns perform the addition
of two floating-point numbers and place the normalizedre sult 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 4308 21 00 00 00 00 00 = 82.1
16== approximately 130.06
10 Storage locations 2000-2007 contain 41 12 34 56 00 00 00 00 = 1.23456
16== approximately 1.13
10 (normalized)
Register 13 contains00 00 20 00 The instruction
Machine Format000 Assembler Format Op Code R
1
,02 (X
2
, 82)
AE6,0(0,13) can be used to perform the short-precision addition of the
two operands. In this example, the instruction operates as
follows:
The characteristics of the two numbers are compared.Since the number in storage has a characteristic that is smaller
by 2, it is right-shifted after fetching until the characters
agree. The two numbers are then added:
FPR6: 4308 21 00 Guard
DigitShifted number from storage: 43 00 12 34 5
Intermediate sum: 4308 33 34 5
Because the intermediate sum is unnorinaiized, it isleft shifted to form the normalized floating-point number 42 83
33 45 (= 83.3345
16 =131.2
10
), This number replaces the
high-order portion ofFPR6. The low-order portion of FPR6 and the contents of storage locations 2000-2007 are
unchanged.
If the long-precision instruction AD is used, the result inFPR6 will be 42 83 33 45 600000 dO. Note that, in this
case, the use of the long-precision instruction provides one
additional hexadecimal digit of precision.
Add Unnormalized (AU, AUR, AW,AWR) The ADD UNNORMALIZED instructions operate identi cally to the ADD NORMALIZED instructions, except that
the final result is not normaHzed when ADDUNNORMAL IZED is used. For example, using the same operands as in
the example for ADDNORMALIZED, when the short precision instruction
Machine Format
7EI 6 I 0 I ° I 000 Appendix I. Number Representation and Instruction-Use Examples 309
If the scale factor is -3, FIELD4 represents
127 x
The implied decimal point is
to the left; because the shift was to the righi.
FIELD4 is rounded to the nearest two deciinal
places.
In the preceding cases, the implied decimal is shifted two
places to the left, under control of
resolved when the contents
added to the displacement D2, effecting the multiplication
of FIELD4 by a variable
Assume that the signed, packed-decimal field at storage
Register 9 contains
Machine Format
F8
valid sign and digit codes, it may contain any combination
of hexadecimal digits.
respectively.
Add Normalized (AE, AER, AD, ADR)
The ADD
of two floating-point numbers and place the normalized
to be added must necessarily be normalized before addition
occurs. For example, assume that:
FPR6 contains 43
16
10
16
10 (normalized)
Register 13 contains
Machine Format
1
,
2
, 82)
AE
two operands. In this example, the instruction operates as
follows:
The characteristics of the two numbers are compared.
by 2, it is right-shifted after fetching until the characters
agree. The two numbers are then added:
FPR6: 43
Digit
Intermediate sum: 43
Because the intermediate sum is unnorinaiized, it is
33 45 (= 83.3345
16 =
10
),
high-order portion of
unchanged.
If the long-precision instruction AD is used, the result in
case, the use of the long-precision instruction provides one
additional hexadecimal digit of precision.
Add Unnormalized (AU, AUR, AW,
the final result is not normaHzed when ADD
the example for ADD
Machine Format
7E








































































































































































































































































































































