Subfield 6: Nominal Value

The syntax for coding the nominal value is shown in the subfield format on page ***.

You must specify the nominal value subfield unless a duplication value of zero is specified. It defines the value of the constant (or constants) described and affected by the subfields that precede it. It is this value that is assembled into the internal binary representation of the constant. Table 21 shows the formats for specifying constants.

Table 21. Specifying constant values
Constant
Type
Single
Nominal Value
Multiple
Nominal Value
Topic No.
C 'value' not allowed Character constant--C
G '<.v.a.l.u.e>' not allowed Graphic constant--G
B
X
H
F
P
Z
E
D
L
'value' 'value,value,...value'
A
Y
S
V
R
(value) (value,value,...value)
Q (value) (value,value,...value) Offset constant--Q
J (value) (value,value,...value) Length constant--J

As the above list shows:

Spaces are allowed and ignored in nominal values for the quoted constant types (BDEFHLPXZ). Spaces are significant for C and G constant types.

How nominal values are specified and interpreted by the assembler is explained in each of the subsections that follow. There is a subsection for each of the following types of constant:

Literal constants are described on page Literal constants.

Binary constant--B

The binary constant specifies the precise bit pattern assembled into storage. Each binary constant is assembled into the integral number of bytes (see  1  in Table 22) required to contain the bits specified, unless a bit-length modifier is specified.

The following example shows the coding used to designate a binary constant. BCON has a length attribute of 1.

BCON     DC              B'11011101'
BTRUNC   DC              BL1'100100011'
BPAD     DC              BL1'101'
BFOUR    DC              B'1111 0100 1111 0100'

BTRUNC assembles with the leftmost bit truncated, as follows:

00100011

BPAD assembles with five zeros as padding, as follows:

00000101
Table 22. Binary constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type B
3. Type Extension Not Allowed
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
As needed
 
B  DC  B'10101111'
C  DC  B'101'
 
L'B = 1  1 
L'C = 1  1 
Alignment: Byte
Range for length:
1 to 256
(byte length)
 
.1 to .2048
(bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
Binary digits
(0 or 1)
Enclosed by: Single quotation marks
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: With zeros at left
   Truncation of
   assembled value:
At left

Character constant--C

The character constant specifies character strings, such as error messages, identifiers, or other text, that the assembler converts into binary representations. If no type extension is provided, then the constant may be changed, depending on the value of the TRANSLATE option. If the type extension of "E" is provided, then the representation is also EBCDIC, but it cannot be changed by the TRANSLATE option. For information about type extension "A" see ASCII data in character constants, and for information about type extension "U" see Unicode UTF-16 data from character constants.

Any of the 256 characters from the EBCDIC character set may be designated in a character constant. Each character specified in the nominal value subfield is assembled into one byte (see  1  in Table 23). For more information, see the discussion about the 82 invariant characters in Character self-defining term.

A null nominal value is permitted if a length is specified. For example:

         DC              CL3''

is assembled as three EBCDIC spaces with object code X'404040', whereas

         DC              CAL3''

is assembled as three ASCII spaces with object code X'202020'.

Multiple nominal values are not allowed because a comma in the nominal value is considered a valid character (see  2  in Table 23) and is assembled into its binary (EBCDIC) representation (see Appendix D. Standard character set code table). For example:

         DC              C'A,B'

is assembled as A,B with object code X'C16BC2'.

Give special consideration to representing single quotation marks and ampersands as characters. Each single quotation mark or ampersand you want as a character in the constant must be represented by a pair of single quotation marks or ampersands. Each pair of single quotation marks is assembled as one single quotation mark, and each pair of ampersands is assembled as one ampersand (see  3  in Table 23).

Table 23. Character constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type C
3. Type Extension
U
A
E
U  DC  CU'UNICODE'
A  DC  CA'ASCII'
E  DC  CE'EBCDIC'
L'U = 14
L'A = 5
L'E = 6

4. Program type Allowed
5. Modifiers Implicit length: (length modifier not present)  
Evaluate as an even number, if Type Extension of U is specified
 
C  DC  C'LENGTH'
 
L'C = 6   1 
Alignment: Byte
Range for length:
1 to 256
(byte length)
 
Must be a multiple
of 2 when the
Type Extension is U
 
.1 to .2048
(bit length)
(Not permitted
if Type Extension
of U is specified.)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
Characters
(all 256 8-bit
combinations)
 
DC C'A''B'
DC CU'AA'
DC CA'AB'
Object code
X'C17DC2'   3 
X'00410041'
X'4142'
Enclosed by: Single quotation marks
Exponent allowed: No (would be interpreted as character data)
   Number of values
   per operand:
One DC C'A,B'
Object code
X'C16BC2'   2 
Padding: With spaces at right (X'40' EBCDIC, X'20' ASCII)
   Truncation of
   assembled value:
At right

In the following example, the length attribute of FIELD is 12:

FIELD    DC              C'TOTAL IS 110'

However, in this next example, the length attribute is 15, and three spaces appear in storage to the right of the zero:

FIELD    DC              CL15'TOTAL IS 110'

In the next example, the length attribute of FIELD is 12, although 13 characters appear in the operand. The two ampersands are paired, and so count as only one byte.

FIELD    DC              C'TOTAL IS &&10'

In the next example, a length of 4 has been specified, but there are five characters in the constant.

FIELD    DC              3CL4'ABCDE'

The generated constant would be:

ABCDABCDABCD

The same constant could be specified as a literal.

         MVC             AREA(12),=3CL4'ABCDE'

On the other hand, if the length modifier had been specified as 6 instead of 4, the generated constant would have been:

ABCDE ABCDE ABCDE (with one trailing space)
ASCII data in character constants

For Character ASCII (CA) constants the character string is converted to ASCII, assuming that the characters in the nominal value are represented in code page 37. Any paired occurrences of ampersands and apostrophes are converted to a single occurrence of such a character prior to conversion. The assembler then maps each EBCDIC character into its ASCII equivalent. This constant is not modified by the TRANSLATE option.

Unicode UTF-16 data from character constants

For Character Unicode (CU) constants the value is converted to Unicode UTF-16 using the code page identified via the CODEPAGE assembler option. Any paired occurrences of ampersands and apostrophes are converted to a single occurrence of such a character prior to conversion. If necessary the value is padded with EBCDIC spaces on the right (X'40'). The assembler then maps each EBCDIC character into its 2-byte Unicode UTF-16 equivalent.

For example:

UA     DC       CU'UTF-16'        object code X' 005500540046002D00310036'
UB     DC       CUL4'L'           object code X' 004C0020'
UC     DC       CUL2'XYZ'         object code X' 0058'
Double-byte data in character constants

When the DBCS assembler option is specified, double-byte data may be used in a character constant. The start of double-byte data is delimited by SO, and the end by SI. All characters between SO and SI must be valid double-byte characters. No single-byte meaning is drawn from the double-byte data. Hence, special characters such as the single quotation mark and ampersand are not recognized between SO and SI. The SO and SI are included in the assembled representation of a character constant containing double-byte data.

If a duplication factor is used, SI/SO pairs at the duplication points are not removed. For example, the statement:

DBCS     DC              3C'<D1>'

results in the assembled character string value of:

<D1><D1><D1>

Null double-byte data (SO followed immediately by SI) is acceptable and is assembled into the constant value.

The following examples of character constants contain double-byte data:

DBCS0    DC              C'<>'
DBCS1    DC              C'<.D.B.C.S>'
DBCS2    DC              C'abc<.A.B.C>'
DBCS3    DC              C'abc<.A.B.C>def'

The length attribute includes the SO and SI. For example, the length attribute of DBCS0 is 2, and the length attribute of DBCS2 is 11. No truncation of double-byte character strings within C-type constants is allowed, since incorrect double-byte data would be created.

It is possible to generate invalid DBCS data in these situations:

Graphic constant--G

When the DBCS assembler option is specified, the graphic (G-type) constant is supported. This constant type allows the assembly of pure double-byte data. The graphic constant differs from a character constant containing only double-byte data in that the SO and SI delimiting the start and end of double-byte data are not present in the assembled value of the graphic constant. Because SO and SI are not assembled, if a duplication factor is used, no redundant SI/SO characters are created. For example, the statement:

DBCS     DC              3G'<D1>'

results in the assembled character string value of:

D1D1D1

Examples of graphic constants are:

DBCS1    DC              G'<.A.B.C>'
DBCS2    DC              GL10'<.A.B.C>'
DBCS3    DC              GL4'<.A.B.C>'

Because the length attribute does not include the SO and SI, the length attribute of DBCS1 is 6. The length modifier of 10 for DBCS2 causes padding of 2 double-byte spaces at the right of the nominal value. The length modifier of 4 for DBCS3 causes truncation after the first 2 double-byte characters. The length attribute of a graphic constant must be a multiple of 2.

Type attribute of G-type constant

Don't confuse the G-type constant character with the type (data) attribute of a graphic constant. The type attribute of a graphic constant is @, not G. See the general discussion about data attributes on page Data attributes, and Type attribute (T').

Table 24. Graphic constants
Subfield Value Example Result
1. Duplication factor Allowed
DC 3G'<.A>'
Object code
X'42C142C142C1'
2. Type G
3. Type Extension Not allowed
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
As needed
(twice the number of DBCS characters)
 
GC  DC  G'<.A.B>'
 
L'GC = 4
Alignment: Byte
Range for length: 2 to 256, must be multiple of 2
(byte length)
bit length not allowed
6. Nominal value
   Represented by:
 
DBCS characters
delimited by SO
and SI
 
DC  G'<.&.'>'
DC  G'<.A><.B>'
Object code
X'4250427D'
X'42C142C2'
Enclosed by: Single quotation marks
   Number of values
   per operand:
One
 
DC  G'<.A.,.B>'
Object code
X'42C1426B42C2'
Padding: With DBCS spaces at right (X'4040')
 
DC  GL6'<.A>'
Object code
X'42C140404040'
   Truncation of
   assembled value:
At right
 
DC  GL2'<.A.B>'
Object code
X'42C1'

Hexadecimal constant--X

Hexadecimal constants generate large bit patterns more conveniently than binary constants. Also, the hexadecimal values you specify in a source module let you compare them directly with the hexadecimal values generated for the object code and address locations printed in the program listing.

Each hexadecimal digit (see  1  in Table 25) specified in the nominal value subfield is assembled into four bits (their binary patterns can be found in Self-defining terms). The implicit length in bytes of a hexadecimal constant is then half the number of hexadecimal digits specified (assuming that a high-order hexadecimal zero is added to an odd number of digits). See  2  and  3  in Table 25.

An 8-digit hexadecimal constant provides a convenient way to set the bit pattern of a full binary word. The constant in the following example sets the first and third bytes of a word with all 1 bits.

         DS              0F
TEST     DC              X'FF00FF00'

The DS instruction sets the location counter to a fullword boundary. (See DS instruction.)

The next example uses a hexadecimal constant as a literal and inserts a byte of all 1 bits into the rightmost 8 bits of register 5.

         IC              5,=X'FF'

In the following example, the digit A is dropped, because 5 hexadecimal digits are specified for a length of 2 bytes:

ALPHACON DC              3XL2'A6F4E'         Generates 6F4E 3 times

The resulting constant is 6F4E, which occupies the specified 2 bytes. It is duplicated three times, as requested by the duplication factor. If it had been specified as:

ALPHACON DC              3X'A6F4E'           Generates 0A6F4E 3 times

the resulting constant would have a hexadecimal zero in the leftmost position.

0A6F4E0A6F4E0A6F4E
Table 25. Hexadecimal constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type X
3. Type Extension Not allowed
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
As needed
 
X  DC  X'FF00A2'
Y  DC  X'F00A2'
 
L'X = 3  2 
L'Y = 3  2 
Alignment: Byte
Range for length:
1 to 256
(byte length)
 
.1 to .2048
(bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
Hexadecimal
digits
(0 to 9 and
A to F)
 
DC  X'1F'
DC  X'91F'
Object code
X'1F'  1 
X'091F'  3 
Enclosed by: Single quotation marks
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: With zeros at left
   Truncation of
   assembled value:
At left

Fixed-point constants--F and H

Fixed-point constants let you introduce data that is in a form suitable for the arithmetic operations of the binary fixed-point machine instructions. The constants you define can also be automatically aligned to the correct doubleword, fullword or halfword boundary for the instructions that refer to addresses on these boundaries (unless the NOALIGN option has been specified; see General information about constants). You can do algebraic operations using this type of constant because they can have positive or negative values.

A fixed-point constant is written as a decimal number, which can be followed by a decimal exponent. The format of the constant is as follows:

  1. The nominal value can be a signed or unsigned (see  1  in Table 26) integer, fraction, or mixed number (see  2  Table 26) followed by a signed exponent (see  3  in Table 26). If a sign is not specified for either the number or exponent, + is assumed. To generate unsigned data, precede the numeric value with the letter U; signs are not allowed.
  2. The exponent must lie within the permissible range (see  4  in Table 26). If an exponent modifier is also specified, the algebraic sum (see  5  in Table 26) of the exponent and the exponent modifier must lie within the permissible range.

Some examples of the range of values that can be assembled into fixed-point constants are given below:

Length Range of signed values that can be assembled Range of unsigned values that can be assembled
8 -263 to 263-1 0 to 264-1
4 -231 to 231-1 0 to 232-1
2 -215 to 215-1 0 to 216-1
1 -27 to 27-1 0 to 28-1

The range of values depends on the implicitly or explicitly specified length (if scaling is disregarded). If the value specified for a particular constant does not lie within the allowable range for a given length, the constant is not assembled, but flagged as an error.

A fixed-point constant is assembled as follows:

  1. The specified number, multiplied by any exponents, is converted to a binary number.
  2. Scaling is done, if specified. If a scale modifier is not provided, the fractional portion of the number is lost.
  3. The binary value is rounded, if necessary. The resulting number does not differ from the exact number specified by more than one in the least significant bit position at the right.
  4. A negative number is carried in two's-complement form.
  5. Duplication is applied after the constant has been assembled.

The statement below generates 3 fullwords of data. The location attribute of CONWRD is the address of the first byte of the first word, and the length attribute is 4, the implied length for a fullword fixed-point constant. The expression CONWRD+4 could be used to address the second constant (second word) in the field.

CONWRD   DC              3F'658474'
Table 26. Fixed-point constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type F and H
3. Type Extension D permitted with type F
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
Doubleword: 8 bytes
Fullword: 4 bytes
Halfword: 2 bytes
   Alignment:
   (Length modifier
   not present)
Doubleword,
fullword or
halfword
Range for length:
1 to 8
(byte length)
 
.1 to .64
(bit length)
Range for scale:
F:  -187 to +346
H:  -187 to +346
Range for exponent: -85 to +75  4  DC HE+75'2E-73'  5  value=2x102
6. Nominal value
   Represented by:
 
Decimal
digits
(0 to 9)
 
Doubleword
DC  FD'-200'  1 
DC  FD'U7890123456'
 
Fullword
DC  FS4'2.25'  2 
DC  FS4'U2.25'
 
Halfword:
DC  H'+200'
DC  HS4'.25'
DC  H'U200'
DC  HS4'U0.25'

Enclosed by: Single quotation marks
Exponent allowed: Yes
Doubleword:
DC  FD'2E6'
DC  FD'U2E6'
 
Fullword:
DC  F'2E6'  3 
DC  F'U2E6'
 
Halfword:
DC  H'2E+1'
DC  H'U2E+1'

   Number of values
   per operand:
Multiple
Padding: With sign bits at left
   Truncation of
   assembled value:
At left
(error message
issued)

In the following example, the DC statement generates a 2-byte field containing a negative constant. Scaling has been specified in order to reserve 6 bits for the fractional portion of the constant.

HALFCON  DC              HS6'-25.46'

In the following example, the constant (3.50) is multiplied by 10 to the power -2 before being converted to its binary format. The scale modifier reserves 12 bits for the fractional portion.

FULLCON  DC              HS12'3.50E-2'

The same constant could be specified as a literal:

         AH              7,=HS12'3.50E-2'

The final example specifies three constants. The scale modifier requests 4 bits for the fractional portion of each constant. The 4 bits are provided whether or not the fraction exists.

THREECON DC              FS4'-10,25.3,U268435455'

Remember that commas separate operands. For readability, use spaces instead, as shown in this example:

TWOCONS  DC              F'123,445'            Two constants
ONECON   DC              F'123 456'            One constant

Decimal constants--P and Z

The decimal constants let you introduce data in a form suitable for operations on decimal data. The packed decimal constants (P-type) are used for processing by the decimal instructions. The zoned decimal constants (Z-type) are in the form (EBCDIC representation) you can use as a print image, except for the digit in the rightmost byte.

The nominal value can be a signed (plus is assumed if the number is unsigned) decimal number. A decimal point may be written anywhere in the number, or it may be omitted. The placement of a decimal point in the definition does not affect the assembly of the constant in any way, because the decimal point is not assembled into the constant; it only affects the integer and scaling attributes of the symbol that names the constant.

The specified digits are assumed to constitute an integer (see  1  in Table 27). You may determine correct decimal point alignment either by defining data so that the point is aligned or by selecting machine instructions that operate on the data correctly (that is, shift it for purposes of decimal point alignment).

Decimal constants are assembled as follows:

Packed decimal constants

Each digit is converted into its 4-bit binary coded decimal equivalent (see  2  in Table 27). The sign indicator (see  3  in Table 27) is assembled into the rightmost four bits of the constant.

Zoned decimal constants

Each digit is converted into its 8-bit EBCDIC representation (see  4  in Table 27). The sign indicator (see  5  in Table 27) replaces the first four bits of the low-order byte of the constant.

The range of values that can be assembled into a decimal constant is shown below:

Type of decimal constant Range of values that can be specified
Packed 1031-1 to -1031
Zoned 1016-1 to -1016

For both packed and zoned decimals, a plus sign is translated into the hexadecimal digit C, a minus sign into the digit D. The packed decimal constants (P-type) are used for processing by the decimal instructions.

If, in a constant with an implicit length, an even number of packed decimal digits is specified, one digit is left unpaired because the rightmost digit is paired with the sign. Therefore, in the leftmost byte, the leftmost four bits are set to zeros and the rightmost four bits contain the unpaired (first) digit.

Table 27. Decimal constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type P and Z
3. Type Extension Not allowed
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
As needed
 
Packed:
P  DC  P'+593'
 
Zoned:
Z  DC  Z'-593'
 
 
L'P = 2
 
 
L'Z= 3
Alignment: Byte
Range for length:
1 to 16
(byte length)
 
.1 to .128
(bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
Decimal
digits
(0 to 9)
 
Packed:
DC  P'5.5'   1 
DC  P'55'    1 
DC  P'+555'  2 
DC  P'-777'

 
Zoned:
DC  Z'-555'  4 
 
Object code
X'055C'
X'055C'
X'555C'  3 
X'777D'  3 
 
Object code
X'F5F5D5'  5 
Enclosed by: Single quotation marks
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding:
Packed:
with binary
zeros at left
 
Zoned:
with EBCDIC
zeros (X'F0')
at left
   Truncation of
   assembled value:
At left

In the following example, the DC statement specifies both packed and zoned decimal constants. The length modifier applies to each constant in the first operand (that is, to each packed decimal constant). A literal could not specify both operands.

DECIMALS DC    PL8'+25.8,-3874,+2.3',Z'+80,-3.72'

The last example shows the use of a packed decimal literal.

         UNPK            OUTAREA,=PL2'+25'

Address constants

An address constant is an absolute or relocatable expression, such as a storage address, that is translated into a constant. Address constants can be used for initializing base registers to facilitate the addressing of storage. Furthermore, they provide a means of communicating between control sections of a multisection program. However, storage addressing and control section communication also depends on the USING assembler instruction and the loading of registers. See USING instruction.

The nominal value of an address constant, unlike other types of constants, is enclosed in parentheses. If two or more address constants are specified in an operand, they are separated by commas, and the whole sequence is enclosed by parentheses. There are seven types of address constants: A, Y, S, R, Q, J and V. A relocatable address constant may not be specified with bit lengths.

Complex relocatable expressions

A complex relocatable expression can only specify an A-or Y-type address constant. These expressions contain two or more unpaired relocatable terms, or two or more negative relocatable terms in addition to any absolute or paired relocatable terms. A complex relocatable expression might consist of external symbols and designate an address in an independent assembly that is to be linked and loaded with the assembly containing the address constant.

The following example shows how, and why, a complex relocatable expression could be used for an A or Y address constant:

         EXTRN           X
 B       DC              A(X-*)       Offset from B to X
Address constants--A and Y

The following sections describe how the different types of address constants are assembled from expressions that usually represent storage addresses, and how the constants are used for addressing within and between source modules.

In the A-type and Y-type address constants, you can specify any of the three following types of assembly-time expressions whose values the assembler then computes and assembles into object code. Use this expression computation as follows:

Literals, which are relocatable forms, are not allowed as operands, but length, scale and integer attribute references to literals are allowed.

Here are some examples:

     DC   A(L'=F'1.23')
     DC   A(I'=F'3.45')
     DC   A(S'=FS6'7.89)

Notes:
  1. No bit-length modifier (see  1  in Table 28) is allowed when a relocatable or complex relocatable expression (see  2  in Table 28) is specified. The only explicit lengths that can be specified with relocatable or complex relocatable address constants are: The linkage editor/binder/loader you use determines which lengths are actually supported. Please see the appropriate product manual for more information.

    For absolute operands, you may specify byte or bit lengths:

  2. The value of the location counter reference (*) when specified in an address constant varies from constant to constant, if any of the following, or a combination of the following, are specified:

    The location counter is incremented with the length of the previously assembled constant.

  3. When the location counter reference occurs in a literal address constant, the value of the location counter is the address of the first byte of the instruction.

    Note that the behavior of location counter references in A-type address constants is different from that in S-type address constants (Address constant--S).

Table 28. A and Y address constants
Subfield Value Example Result
1. Duplication factor Allowed A  DC  5AL1(*-A)  4 
Object code
X'0001020304'
2. Type A and Y
3. Type Extension D permitted for A type only
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
A-type: 4 bytes
AD-type: 8 bytes
Y-type: 2 bytes
   Alignment:
   (Length modifier
   not present)
A-type: fullword
AD-type: doubleword
Y-type: halfword
Range for length:
A-type:
2 to 4  1 
(byte length)
AD-type:
1 to 8
(byte length)
 
Y-type:
2 only
(byte length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
Absolute,
relocatable,
or complex
relocatable
expressions  2 
 
A-type:
DC  A(ABSOL+10)
 
Y-type:
   DC  Y(RELOC+32)
A  DC  Y(*-A,*+4)  3 
 
 
 
 
 
 
values=0,A+6
Enclosed by: Parentheses
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: If an absolute term is present, by sign extension. Otherwise, with zeros at left.
   Truncation of
   assembled value:
At left

Take care when using Y-type address constants and 2-byte A-type address constants for relocatable addresses, as they can only address a maximum of 65,536 bytes of storage. Using these types of address constants for relocatable addresses results in message ASMA066W being issued unless the assembler option RA2 is specified.

The A-type and Y-type address constants are processed as follows: If the nominal value is an absolute expression, it is computed to its 32-bit value and then truncated or sign-extended on the left to fit the implicit or explicit length of the constant. If the nominal value is a relocatable or complex relocatable expression, it is not completely evaluated until linkage edit time. The relocated address values are then placed in the fields set aside for them at assembly time by the A-type and Y-type constants.

In the following examples, the field generated from the statement named ACON contains four constants, each of which occupies four bytes. The statement containing the LM instruction shows the same set of constants specified as literals (that is, address constant literals).

ACON     DC             A(108,LOP,END-STRT,*+4096)
         LM             4,7,=A(108,LOP,END-STRT,*+4096)

A location counter reference (*) appears in the fourth constant (*+4096). The value of the location counter is the address of the first byte of the fourth constant. When the location counter reference occurs in a literal, as in the LM instruction, the value of the location counter is the address of the first byte of the instruction.

Note:
It is important to remember that expression evaluation for address constants is restricted to using 32-bit internal arithmetic. The result is then sign-extended to the length of the constant. This means that certain expressions in AD-type constants may not yield expected results, especially if the resulting value is negative.
PSECT reference--R

The R-type constant reserves storage for the address of the PSECT of symbol1 as specified in the associated XATTR statement (XATTR instruction (z/OS and CMS)). It is the caller's responsibility to establish the definition of the R-type address constant referencing the called routine's PSECT, and to pass that address to the called routine. This constant is only available if the GOFF option is specified.

Note:
If a program is to be reentrant, R-type address constants may not appear in shared (read-only) text. They should be in the caller's PSECT, and be provided to the called routine using an appropriate convention. That is, R-type address constants referring to PSECTs should themselves reside in PSECTs. If not, there can be only a single instantiation of the PSECT work area, and the program cannot be reentrant.
Table 29. R address constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type R
3. Type Extension D
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
R-type: 4 bytes
RD-type: 8 bytes
   Alignment:
   (Length modifier
   not present)
R-type: Fullword
RD-type: Doubleword
Range for length:
R-type: 3 or 4 only
RD-type: 3, 4 or 8
(no bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
An ordinary symbol
 
DC  R(PSECT1)
Enclosed by: Parentheses
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: With zeros at left
   Truncation of
   assembled value:
Not applicable
Address constant--S

Use the S-type address constant to assemble an explicit address in base-displacement form. You can specify the explicit address yourself or let the assembler compute it from an implicit address, using the current base register and address in its computation.

The nominal values can be specified in two ways:

  1. As one absolute or relocatable expression (see  1  in Table 30) representing an implicit address.
  2. As two absolute expressions (see  2  in Table 30) the first of which represents the displacement and the second, enclosed in parentheses, represents the base register.

The address value represented by the expression in  1  in Table 30, is converted by the assembler into the correct base register and displacement value. An S-type constant is assembled as a halfword and aligned on a halfword boundary. An SY-type constant is assembled as 3 bytes and aligned on a halfword boundary. The leftmost four bits of the assembled constant represent the base register designation; the remaining 12 bits (S-type) or 20 bits (SY-type), the displacement value.

Notes:
  1. The value of the location counter (*) when specified in an S-type address constant varies from constant to constant if one or more the following is specified: In each case the location counter is incremented with the length of the previously assembled constant, except when multiple S-type address constants are specified in a literal. In a literal, the same location counter value is used for each of the multiple values.
  2. If a length modifier is used, only 2 bytes for an S-type constant, or only 3 bytes for an SY-type constant, may be specified.
  3. S-type address constants can be specified as literals. The USING instructions used to resolve them are those in effect at the place where the literal pool is assembled, and not where the literal is used.
  4. The location counter value used in the literal is the value at the point where the literal is used, not where it is defined.

    For example:

        USING *,15
        DC    2S(*)        generates F000F002
        LA    1,=2S(*)     generated constants are F004F004

    Note that this behavior is different from that in A-type address constants and Y-type address constants.

Table 30. S address constants
Subfield Value Example Result  
1. Duplication factor Allowed
2. Type S
3. Type Extension Y
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
2 bytes (S-type)
3 bytes (SY-type)
   Alignment:
   (Length modifier
   not present)
Halfword
Range for length:
2 (S) or 3(SY) only
(no bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value Base Disp
   Represented by:
Absolute or relocatable expression  1 
DC  S(RELOC)
DC  S(1024)
X
0
YYY
400
Two absolute expressions  2 
DC  S(512(12))
DC SY(-2(3))
C
3
200
FFEFF
Enclosed by: Parentheses
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: Not applicable
   Truncation of
   assembled value:
Not applicable
Address constant--V

The V-type constant reserves storage for the address of a location in a control section that is defined in another source module. Use the V-type address constant only to branch to an external address, because link-time processing may cause the branch to be indirect (for example, an assisted linkage in an overlay module). That is, the resolved address in a V-type address constant might not contain the address of the referenced symbol. In contrast, to refer to external data you should use an A-type address constant whose nominal value specifies an external symbol identified by an EXTRN instruction.

Because you specify a symbol in a V-type address constant, the assembler assumes that it is an external symbol. A value of zero is assembled into the space reserved for the V-type constant; the correct relocated value of the address is inserted into this space by the linkage editor before your object program is loaded.

The symbol specified (see  1  in Table 31) in the nominal value subfield does not constitute a definition of the symbol for the source module in which the V-type address constant appears.

The symbol specified in a V-type constant must not represent external data in an overlay program.

Table 31. V address constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type V
3. Type Extension D
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
V-type: 4 bytes
VD-type: 8 bytes
VL4(ExtSym)
   Alignment:
   (Length modifier
   not present)
V-type: Fullword
VD-type: Doubleword
Range for length:
V-type: 4 or 3 only
VD-type: 3, 4 or 8
(no bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
A single external
symbol
 
DC  V(MODA)  1 
DC  V(EXTADR)  1 
Enclosed by: Parentheses
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: None
   Truncation of
   assembled value:
Not applicable

In the following example, 12 bytes are reserved, because there are three symbols. The value of each assembled constant is zero until the program is link-edited.

VCONST   DC              V(SORT,MERGE,CALC)

Offset and length constants

This section describes the offset constant (Offset constant--Q) and length constant (Length constant--J).

Offset constant--Q

Use this constant to reserve storage for the offset into a storage area of an external dummy section, or the offset to a part or label in a class. The offset is entered into this space by the linker. When the offset is added to the address of an overall block of storage set aside for external dummy sections, it addresses the applicable section.

For a description of the use of the Q-type offset constant in combination with an external dummy section, see External dummy sections. See also Table 32 for details.

In the following example, to access the external dummy section named VALUE, the value of the constant labeled A is added to the base address of the block of storage allocated for external dummy sections.

A        DC              Q(VALUE)

The DXD, DSECT, or part names referenced in the Q-type offset constant need not be previously defined.

Table 32. Q offset constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type Q
3. Type Extension D, Y
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
Q-type: 4 bytes
QD-type: 8 bytes
QY-type: 3 bytes
Q(DXDEXT)
   Alignment:
   (Length modifier
   not present)
Q-type: Fullword
QD-type: Quadword
QY-type: Halfword
Range for length:
Q-type: 1 to 4 bytes
QD-type: 1 to 8 bytes
QY-type: 3 bytes only
(no bit length)

QL2(DXDEXT)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
A DXD, DSECT, or part
name (an
external symbol)
 
DC  Q(DUMMYEXT)
DC  Q(DXDEXT)
Enclosed by: Parentheses
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: None
   Truncation of
   assembled value:
Not applicable
Length constant--J

Use this constant to reserve storage for the length of a DXD, class or DSECT. The assembler fills the field with binary zeros, and the length is entered into this space by the linker. This constant is only available if the GOFF option is specified.

In the following example, the value at A is the length of CLASS.

A        DC              J(CLASS)

The DXD or DSECT names referenced in the J-type length constant need not be previously defined.

Table 33. J length constants
Subfield Value Example Result
1. Duplication factor Allowed
2. Type J
3. Type Extension D
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
J-type: 4 bytes
JD-type: 8 bytes
   Alignment:
   (Length modifier
   not present)
J-type: Fullword
JD-type: Doubleword
Range for length:
J-type: 2 to 4 bytes,
        or 8
JD-type: 2 to 4 bytes,
        or 8
(no bit length)
Range for scale: Not allowed
Range for exponent: Not allowed
6. Nominal value
   Represented by:
 
A single DXD, class,
or DSECT name
 
DC  J(CLASS)
Enclosed by: Parentheses
Exponent allowed: No
   Number of values
   per operand:
Multiple
Padding: None.
   Truncation of
   assembled value:
At left

Hexadecimal floating-point constants--E, EH, D, DH, L, LH, LQ

Floating-point constants let you introduce data that is in the form suitable for the operations of the floating-point feature instructions. These constants have the following advantages over fixed-point constants:

The nominal value can be a signed (see  1  in Table 34) integer, fraction, or mixed number (see  2  Table 34) followed by a signed exponent (see  3  in Table 34). If a sign is not specified for either the number or exponent, a plus sign is assumed.

If you specify the 'H' type extension you can also specify a rounding mode that is used when the nominal value is converted from decimal to its hexadecimal form. The syntax for nominal values (including the binary floating-point constants) is shown in Figure 20. The valid rounding mode values are:

Figure 18. Rounding mode values
1
Round by adding one in the first lost bit position
4
Unbiased round to nearest, with tie-breaking rule
5
Round towards zero (that is, truncate)
6
Round up towards the maximum positive value
7
Round down towards the minimum negative value

See  4  in Table 34.

The exponent must lie within the permissible range. If an exponent modifier is also specified, the algebraic sum of the exponent and the exponent modifier must lie within the permissible range.

Table 34. Hexadecimal floating-point constants
Subfield Value Example
1. Duplication factor Allowed
2. Type E, D, and L
3. Type Extension Omitted or H or Q
4. Program type Allowed
5. Modifiers
   Implicit length:
   (length modifier
   not present)
 
E-type: 4 bytes
D-type: 8 bytes
L-type: 16 bytes
   Alignment:
   (Length modifier
   not present)
E-type: Fullword
D-type: Doubleword
L-type: Doubleword
LQ-type: Quadword
Range for length:
E-type:
1 to 8 (byte length)
.1 to .64 (bit length)
EH-type:
.12 to .64 (bit length)
 
D-type:
1 to 8 (byte length)
.1 to .64 (bit length)
DH-type:
.12 to .64 (bit length)
 
L-type:
1 to 16 (byte length)
.1 to .128 (bit length)
LH-type:
.12 to .128 (bit length)
LQ-type:
.12 to .128 (bit length)
Range for scale:
E-type: 0 to 5
D-type: 0 to 13
L-type: 0 to 27

Range for exponent: -85 to +75
6. Nominal value
   Represented by:
 
Decimal digits
 
E-type:
DC  E'+525'  1 
DC  E'5.25'  2 
 
D-type:
DC  D'-525'  1 
DC  D'+.001'  2 
 
L-type:
DC  L'525'
DC  L'3.414'  2 
Enclosed by: Single quotation marks
Exponent allowed: Yes
E-type:
DC  E'1E+60'  3 
 
D-type:
DC  D'-2.5E10'  3 
 
L-type:
DC  L'3.712E-3'  3 
   Rounding mode
   allowed if
   type extension
   specified:
Yes (see Figure 18 for values)
E-type:
DC  EH'1E+60R1'  4 
 
D-type:
DC  DH'-2.5E10R4'  4 
 
L-type:
DC  LH'3.712E-3R5'  4 
   Number of values
   per operand:
Multiple
Padding: Correct fraction is extended to the right and rounded
   Truncation of
   assembled value:
Only if rounding mode 5; rounded otherwise.

The format of the constant is shown in Figure 19.

The value of the constant is represented by two parts:

A sign bit (see  3  in Figure 19) indicates whether a positive or negative number has been specified. The number specified must first be converted into a hexadecimal fraction before it can be assembled into the correct internal format. The quantity expressed is the product of the fraction (see  4  in Figure 19) and the number 16 raised to a power (see  5  in Figure 19). Figure 19 shows the external format of the three types of floating-point constants.

Here is the range of values that can be assembled into hexadecimal floating-point constants:

Type of
Constant
Range of Magnitude (M) of Values
(Positive and Negative)
E 16-65 <= M <= (1-16-6) x 1663
D 16-65 <= M <= (1-16-14) x 1663
L 16-65 <= M <= (1-16-28) x 1663
E, D, L 5.4 x 10-79 <= M <= 7.2 x 1075 (approximate)

If the value specified for a particular constant does not lie within these ranges, the assembled value then depends on these factors:

Figure 19. Hexadecimal floating-point external formats
Type | Called     | Format
-----+------------+----------------------------------------------------------------
E    | Short      |         1  7-bit Characteristic      2  24-bit Fraction
EH   | Floating-  |  3    + *----------*----------* *------------*------------*
     | Point      |  |  *---*---------------------* *-----------/ /-----------*
     | Number     |  *> *---*---------------------* *-----------/ /-----------*
     |            |       -
     |            | Bits 0   1                 7     8                       31
     |            |
     |            |
     |            |
D    | Long       |          7-bit Characteristic         56-bit Fraction
DH   | Floating-  |       + *----------*----------* *------------*------------*
     | Point      |     *---*---------------------* *-----------/ /-----------*
     | Number     |     *---*---------------------* *-----------/ /-----------*
     |            |       -
     |            | Bits 0   1                 7     8                       63
     |            |
     |            |
     |            |
     |            |                                     High-order 56 bits
L    | Extended   |          7-bit Characteristic       of 112-bit Fraction
LH   | Floating-  |       + *----------*----------* *------------*------------*
LQ   | Point      |     *---*---------------------* *-----------/ /-----------*
     | Number     |     *---*---------------------* *-----------/ /-----------*---*
     |            |       -                                                       |
     |            | Bits 0   1                 7     8                       63   |
     |            |                                                               |
     |            |                                 *-----------------------------*
     |            |                                 |
     |            |                                 |   Low-order 56 bits
     |            |          7-bit Characteristic   V   of 112-bit Fraction
     |            |       + *----------*----------* *------------*------------*
     |            |     *---*---------------------* *-----------/ /-----------*
     |            |     *---*---------------------* *-----------/ /-----------*
     |            |       -           ^
     |            | Bits 0   1        |        7     8                       63
     |            |                   |
     |            |            Set in second half
     |            |            of L-type constant


Characteristic    | Hexadecimal Fraction
------------------+----------------------------------
                  |    4 
                  |    a     b      c
 5     16E        X [ --- + ---  + ---  + ... ]
                  |   16    162    163
                  |

where a,b,c ... are hexadecimal digits, and E is an exponent that has a positive or negative value indicated by the characteristic

Representation of hexadecimal floating point

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:

The excess-64 binary notation is obtained by adding +64 to the value of the exponent (which lies between -64 and +63) to yield the characteristic (which lies between 0 and 127).

Notes:
  1. 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 double-word aligned. The LQ-type is quad-word aligned. A DC 0LQ forces the alignment to a quad-word boundary.

  2. 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.)
  3. 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.
  4. Negative fractions are carried in true representation, not in the two's-complement form.
  5. Duplication is applied after the constant has been assembled.
  6. An implied length of 4 bytes is assumed for a short (E) constant and 8 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 8 bytes (E and D) or 16 bytes (L) can be specified by a length modifier. In this case, no boundary alignment occurs.
  7. 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. Note that 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 would generate 3 doubleword floating-point constants.

FLOAT    DC              DE(+4)'+46,-3.729,+473'

Binary floating-point constants--EB, DB, LB

Binary floating-point numbers may be represented in any of three formats: short, long or extended. The short format is 4 bytes with a sign of one bit, an exponent of 8 bits and a fraction of 23 bits. The long format is 8 bytes with a sign of one bit, an exponent of 11 bits and a fraction of 52 bits. The extended format is 16 bytes with a sign of one bit, an exponent of 15 bits and a fraction of 112 bits.

There are five classes of binary floating-point data, including numeric and related nonnumeric entities. Each data item consists of a sign, an exponent and a significand. The exponent is biased such that all exponents are nonnegative unsigned numbers, and the minimum biased exponent is zero. The significand consists of an explicit fraction and an implicit unit bit to the left of the binary point. The sign bit is zero for plus and one for minus values.

All finite nonzero numbers within the range permitted by a given format are normalized and have a unique representation. There are no unnormalized numbers, which might allow multiple representations for the same value, and there are no unnormalized arithmetic operations. Tiny numbers of a magnitude below the minimum normalized number in a given format are represented as denormalized numbers, because they imply a leading zero bit, but those values are also represented uniquely.

The classes are:

  1. Zeros have a biased exponent of zero, a zero fraction and a sign. The implied unit bit is zero.
  2. Denormalized numbers have a biased exponent of zero and a nonzero fraction. The implied unit bit is zero.

    The smallest denormalized numbers have approximate magnitudes 1.4 10**-45 (short format), 4.94 10**-324 (long format) and 6.5 10**-4966 (extended format).

  3. Normalized numbers have a biased exponent greater than zero but less than all ones. The implied unit bit is one and the fraction may have any value. The largest normalized numbers have approximate magnitudes 3.4 10**38 (short format), 1.8 10**308 (long format), and 1.2 10**4932 (extended format). The smallest normalized numbers have approximate magnitudes 1.18 10**-38 (short format), 2.23 10**-308 (long format), and 3.4 10**-4392 (extended format).
  4. An infinity is represented by a biased exponent of all ones and a zero fraction.
  5. A NaN (Not-a-Number) entity is represented by a biased exponent of all ones and a nonzero fraction. NaNs are produced in place of a numeric result after an invalid operation when there is no interruption. NaNs may also be used by the program to flag special operands, such as the contents of an uninitialized storage area. There are two types of NaNs, signaling and quiet. A signaling NaN (SNaN) is distinguished from the corresponding quiet NaN (QNaN) by the leftmost fraction bit: zero for the SNaN and one for QNaN. A special QNaN is supplied as the default result for an invalid-operation condition; it has a plus sign and a leftmost fraction bit of one, with the remaining fraction bits being set to zeros. Normally, QNaNs are just propagated during computations, so that they remain visible at the end. An SNaN operand causes an invalid operation exception.

Decimal floating-point constants--ED, DD, LD

Decimal floating-point numbers may be represented in any of three formats: short, long or extended. The short format is 4 bytes with a sign of one bit, a cominbation field of 5 bits, an exponent continuation field of 6 bits, and a signification continuation field of 20 bits. The long format is 8 bytes with a sign of one bit, a cominbation field of 5 bits, an exponent continuation field of 8 bits, and a signification continuation field of 50 bits. The extended format is 16 bytes with a sign of one bit, a cominbation field of 5 bits, an exponent continuation field of 12 bits, and a signification continuation field of 110 bits.

There are four classes of decimal floating-point data, including numeric and related nonnumeric entities. Each data item consists of a sign, an exponent and a significand. The exponent is biased such that all exponents are nonnegative unsigned numbers, and the minimum biased exponent is zero. The significand consists of an explicit fraction and an implicit unit bit to the left of the decimal point. The sign bit is zero for plus and one for minus values.

The classes are:

  1. Zeros have a biased exponent of zero, a zero fraction and a sign. The implied unit bit is zero.
  2. Numbers have a biased exponent greater than zero but less than all ones. The largest numbers have approximate values 1097 (short format), 10385 (long format), and 101145 (extended format). The smallest numbers have approximate values 10-101 (short format), 10-398 (long format), and 10-6176 (extended format).
  3. An infinity is represented by a combination field of 11110 (binary).
  4. A NaN (Not-a-Number) is represented by a combination field of 11111 (binary). A signaling NaN (SNaN) is distinguished from a quiet NaN (QNaN) by bit 6 of the data format: 1 for SNaN and 0 for QNaN.

The rounding modes used for decimal floating point are:

R8
Decimal floating point equivalent of binary floating point R4 (round-half-even)
R9
Decimal floating point equivalent of binary floating point R5 (truncate; round-down)
R10
Decimal floating point equivalent of binary floating point R6 (-> +<inf>; ceiling)
R11
Decimal floating point equivalent of binary floating point R7 (-> -<inf>; floor)
R12
Decimal floating point equivalent of binary floating point R1 (round-half-up)
R13
Round-half-down (no binary floating point equivalent)
R14
Round-up (away-from-zero, no binary floating point equivalent)
R15
Decimal floating point: round-for-reround, or 'prepare for shorter precision'; OR sticky with low-order bit.

Syntax of binary, decimal, and hexadecimal floating-point constants

The syntax for coding binary, decimal, and hexadecimal floating-point constants is:

Figure 20. DC instruction syntax for floating point constants
Read syntax diagramSkip visual syntax diagram>>-DC--+------------+--+-+-E-+--+---+-+--+--------------+------->
       '-dup_factor-'  | +-D-+  +-B-+ |  '-program_type-'  
                       | '-L-'  +-H-+ |                    
                       |        '-D-' |                    
                       '-LQ-----------'                    
 
>--+----------+--| nominal_value |-----------------------------><
   '-modifier-'                     
 
nominal_value (no type extension):
 
      .- + -.                          
|--'--+-----+--value--+----------+--'---------------------------|
      '- - -'         '-exponent-'     
 
nominal_value (type extension B):
 
      .- + -.                       .-R4-------.     
|--'--+-----+--value--+----------+--+----------+--'-------------|
      '- - -'         '-exponent-'  '-R--+-1-+-'     
                                         +-5-+       
                                         +-6-+       
                                         '-7-'       
 
nominal_value (type extension H):
 
      .- + -.                       .-R1-------.     
|--'--+-----+--value--+----------+--+----------+--'-------------|
      '- - -'         '-exponent-'  '-R--+-4-+-'     
                                         +-5-+       
                                         +-6-+       
                                         '-7-'       
 
nominal_value (type extension D):
 
      .- + -.                       .-R12-------.     
|--'--+-----+--value--+----------+--+-----------+--'------------|
      '- - -'         '-exponent-'  '-R--+-8--+-'     
                                         +-9--+       
                                         +-10-+       
                                         +-11-+       
                                         +-13-+       
                                         +-14-+       
                                         '-15-'       
 
dup_factor
causes the constant to be generated the number of times indicated by the factor.
type
indicates that the constant is either short, long or extended floating point.
type extension
the type of conversion required to assemble the constant. Valid values are:
null
Hexadecimal floating-point constant which is converted using the conversion logic of rounding mode 1 and slightly less precise algorithms
B
Binary floating-point constant which is converted allowing all rounding modes
D
Decimal floating-point constant which is converted allowing all rounding modes
H
Hexadecimal floating-point constant which is converted allowing all rounding modes
program_type
assign a programmer determined 32-bit value to the symbol naming the DC instruction, if a symbol was present.
modifier
describes the length, the scaling and the exponent of the nominal_value. The minimum length of the 'H' hexadecimal constant is 12 bits. The minimum length in bits of the binary constant is:
9
Short floating-point constant
12
Long floating-point constant
16
Extended floating-point constant
This minimum length allows for the sign, exponent, the implied unit bit which is considered to be one for normalized numbers and zero for zeros and denormalized numbers.

The exponent modifier can be in the range from -231 to 231-1 if either B or H is specified as a type extension. The only valid length modifiers for decimal floating point constants are 4 bytes (short format), 8 bytes (long format), and 16 bytes (extended format).

nominal_value
defines the value of the constant and can include the integer, fraction or mixed number followed by an optional signed exponent and an optional explicit rounding mode.

The assembler imposes no limits on the exponent values that may be specified. The BFP architecture limits the actual values that can be represented; a warning message is issued whenever a specified value can not be represented exactly.

The rounding mode identifies the rounding required when defining a floating-point constant. The valid values are those displayed in Figure 18.

Note:
As binary floating-point does not support scaling, the scale modifier is ignored and a warning message issued if the scaling modifier is specified when defining a binary floating-point constant. The H type extension causes HLASM to use a different conversion algorithm for hexadecimal floating-point data. The results are correctly rounded for all values. Without the H type extension, some rare values could be in error by 1 unit in the last place (ulp).
Conversion to binary floating-point

For decimal to binary floating-point conversion, the assembler conforms to ANSI/IEEE Std 754-1985, IEEE Standard for Binary Floating-Point Arithmetic, dated August 12, 1985, with the following differences: exception status flags are not provided and traps are not supported.

Conversion of values within the represented range is correctly rounded.

Conversion of values outside the represented range is as follows. If the resultant value before rounding is larger in magnitude than MAX (the maximum allowed value) as represented in the specified length, then, depending on the rounding mode, either MAX or infinity is generated, along with a warning message. If the resultant nonzero value is less than Dmin (the minimum allowed value) as represented in the specified length, then, depending on the rounding mode, either Dmin or zero is generated, along with a warning message.

Floating-point special values

For special values, the syntax of the DC statement is:

Read syntax diagramSkip visual syntax diagram>>-DC--+------------+--+-E-+--+-B-+--+--------------+----------->
       '-dup_factor-'  +-D-+  +-H-+  '-program_type-'  
                       '-L-'  '-D-'                    
 
                       .-,-----------------.  
                       V                   |  
>--+-----------------+---| nominal_value |-+-------------------><
   '-length_modifier-'                        
 
nominal_value (type extension B and D):
 
      .- + -.                 
|--'--+-----+--+-(SNAN)-+--'------------------------------------|
      '- - -'  +-(QNAN)-+     
               +-(NAN)--+     
               +-(INF)--+     
               +-(MAX)--+     
               +-(MIN)--+     
               '-(DMIN)-'     
 
nominal_value (type extension H):
 
      .- + -.                 
|--'--+-----+--+-(MAX)--+--'------------------------------------|
      '- - -'  +-(MIN)--+     
               '-(DMIN)-'     
 
dup_factor
causes the constant to be generated the number of times indicated by the factor.
type
indicates that the constant is either short, long or extended floating point.
type extension
the type of conversion required to assemble the constant.
program_type
assign a programmer determined 32-bit value to the symbol naming the DC instruction, if a symbol was present.
length_modifier
describes the length in bytes or bits into which the constant is to be assembled. For NANs and INF the minimum length in bits of the constant is:
11
Short floating-point constant
14
Long floating-point constant
18
Extended floating-point constant
This minimum length allows for the sign, exponent and two fraction bits. No length modifiers other than 4, 8, or 16 are allowed for decimal floating-point constants.
nominal_value
defines the special value to be generated.
Notes:
  1. The nominal value can be in mixed case.
  2. SNAN assembles with an exponent of ones and 01 in the high order fraction bits with the remainder of the fraction containing zeros.
  3. QNAN assembles with an exponent of ones and 11 in the high order fraction bits with the remainder of the fraction containing zeros.
  4. NAN assembles with an exponent of one and 10 in the high order fraction bits with the remainder of the fraction containing zeros.
  5. MIN assembles as a normalized minimum value, that is an exponent of one and a fraction of zeros for binary constants, and a fraction with a leading hexadecimal digit 1 followed by zeros for hexadecimal constants.
  6. DMIN assembles as a denormalized minimum value with an exponent of zeros and a fraction of all zeros except for a low order bit of one.
  7. INF assembles with an exponent of ones and a fraction of zeros.
  8. MAX assembles with a fraction of all ones and an exponent of all ones for hexadecimal constants, and an exponent of all ones except for the low bit for binary constants.

Literal constants

Literal constants let you define and refer to data directly in machine instruction operands. You do not need to define a constant separately in another part of your source module. The differences between a literal, a data constant, and a self-defining term are described in Literals.

A literal constant is specified in the same way as the operand of a DC instruction. The general rules for the operand subfields of a DC instruction also apply to the subfield of a literal constant. Moreover, the rules that apply to the individual types of constants apply to literal constants as well.

However, literal constants differ from DC operands in the following ways:


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