Padding and truncation of values

The nominal values specified for constants are assembled into storage. The amount of space available for the nominal value of a constant is determined:

The padding and truncation rules discussed below apply to single nominal values.

Padding

If more space is specified than is needed to accommodate the binary representation of the nominal value, the extra space is padded:

Notes:
  1. In floating-point constants (E,D,L), the fraction is extended to occupy the extra space available.
  2. Padding is on the left for all constants except the character constant and the graphic constant.

Truncation

If less space is available than is needed to accommodate the nominal value, the nominal value is truncated and part of the constant is lost. Truncation of the nominal value is:

Notes:
  1. If significant bits are lost in the truncation of fixed-point constants, error diagnostic message ASMA072E Data item too large is issued.
  2. Floating-point constants (E, D, L) are not truncated. They are rounded to fit the space available--see Figure 18 for rounding modes.
  3. The above rules for padding and truncation also apply when using the bit-length modifier (see Subfield 5: Modifier).
  4. Double-byte data in C-type constants cannot be truncated because truncation creates incorrect double-byte data. Error ASMA208E Truncation into double-byte data is not permitted is issued if such truncation is attempted.
  5. Truncation of double-byte data in CU-type and G-type constants is permitted because the length modifier restrictions (see Subfield 5: Modifier) ensure that incorrect double-byte data cannot be created by truncation. However, truncating bit-length constants may create incorrect double-byte data.

[ Top of Page | Previous Page | Next Page | Contents | Index ]