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.
|
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' |
Binary constant--B Hexadecimal constant--X Fixed-point constants--F and H Fixed-point constants--F and H Decimal constants--P and Z Decimal constants--P and Z Hexadecimal floating-point constants--E, EH, D, DH, L, LH, LQ, Binary floating-point constants--EB, DB, LB Hexadecimal floating-point constants--E, EH, D, DH, L, LH, LQ, Binary floating-point constants--EB, DB, LB Hexadecimal floating-point constants--E, EH, D, DH, L, LH, LQ, Binary floating-point constants--EB, DB, LB |
|
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.
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
| 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 |
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).
| 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)
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.
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'
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:
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.
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').
| 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 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
| 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 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:
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:
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'
| 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 |
||
|
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
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:
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.
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.
| 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'
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.
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
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)
For absolute operands, you may specify byte or bit lengths:
The location counter is incremented with the length of the previously assembled constant.
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).
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.
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.
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:
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.
For example:
USING *,15
DC 2S(*) generates F000F002
LA 1,=2S(*) generated constants are F004F004Note that this behavior is different from that in A-type address constants and Y-type address constants.
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.
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)
This section describes the offset constant (Offset constant--Q) and length constant (Length constant--J).
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.
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.
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:
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.
| 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:
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
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).
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.
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 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:
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).
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:
The rounding modes used for decimal floating point are:
The syntax for coding binary, decimal, and hexadecimal floating-point constants is:
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).
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.
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.
For special values, the syntax of the DC statement is:
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 ]