The assembler assembles a floating-point constant into its binary
representation as follows: The specified number, multiplied by any
exponents, is converted to the required two-part format. The value
is translated into:
- A fractional portion represented by hexadecimal digits and the
sign indicator. The fraction is then entered into the leftmost part
of the fraction field of the constant (after rounding).
- An exponent portion represented by the excess-64 binary notation,
which is then entered into the characteristic field of the constant.
The excess-64 binary notation is obtained by adding +64 to the
value of the exponent (-64 - +63) to yield the characteristic (0 -
127).
Notes: - The L-type floating-point constant resembles two contiguous D-type
constants. The sign of the second doubleword is assumed to be the
same as the sign of the first.
The characteristic for the second
doubleword is equal to the characteristic for the first minus 14 (the
number of hexadecimal digits in the fractional portion of the first
doubleword). No indication is given if the characteristic of the second
doubleword is zero.
The L-type and LH-type floating-point
constants are doubleword aligned. The LQ-type is quadword aligned.
A DC 0LQ forces the alignment to a quadword boundary.
- If scaling has been specified, hexadecimal zeros are added to
the left of the normalized fraction (causing it to become unnormalized),
and the exponent in the characteristic field is adjusted accordingly.
(For further details on scaling, see Subfield 5: Modifier.)
- The fraction is rounded according to the implied or explicit length
of the constant. The resulting number does not differ from the exact
value specified by more than one in the last place.
Note: You can
control rounding by using the 'H' type extension and specifying the
rounding mode.
- Negative fractions are carried in true representation, not in
the two's-complement form.
- Duplication is applied after the constant has been assembled.
- An implied length of 4 bytes is assumed for a short (E) constant
and eight bytes for a long (D) constant. An implied length of 16
bytes is assumed for an extended (L) constant. The constant is aligned
at the correct word (E) or doubleword (D and L) boundary if a length
is not specified. However, any length up to and including eight bytes
(E and D) or 16 bytes (L) can be specified by a length modifier. In
this case, no boundary alignment occurs.
- Signed zero values are correctly generated for type extensions
H and B. Without a type extension, zero values of either sign are
assembled with positive sign.
Any of the following statements can be used to specify 46.415 as
a positive, fullword, floating-point constant; the last is a machine
instruction statement with a literal operand. Each of the last two
constants contains an exponent modifier.
DC E'46.415'
DC E'46415E-3'
DC E'+464.15E-1'
DC E'+.46415E+2'
DC EE2'.46415'
AE 6,=EE2'.46415'
The following generates 3 doubleword floating-point constants.
FLOAT DC DE(+4)'+46,-3.729,+473'