HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

DC Instruction With EBCDIC spaces on the right (X'40') for the character (C) constants With EBCDIC spaces on the right (X'40') for the Unicode character (CU) constant prior to translation With double-byte spaces on the right (X'4040') for the graphic (G) constants Notes: 1. In floating-point constants (E,D,L), the fraction is extended to occupy the extra space available. 2. Padding is on the left for all constants except the character constant and the graphic constant. Truncation If less space is available than is needed to accommodate the nominal value, the nominal value is truncated and part of the constant is lost. Truncation of the nominal value is: On the left for the binary (B), hexadecimal (X), fixed-point (H and F), and decimal (P and Z) On the right for the character (C) constant, the Unicode character (CU) constant, and the graphic (G) constant On the left for absolute or relocatable address (A and Y), the external address (V), offset (Q), length (J) and PSECT address (R) constants. The actual value stored and any possible truncation is dependent on the values inserted by the linker/binder and the length of the constant. Notes: 1. If significant bits are lost in the truncation of fixed-point constants, error diagnostic message ASMA72E Data item too large is issued. 2. Floating-point constants (E, D, L) are not truncated. They are rounded to fit the space available—see Figure 50 on page 162 for rounding modes. 3. The above rules for padding and truncation also apply when using the bit-length modifier (see “Subfield 5: Modifier” on page 136). 4. Double-byte data in C-type constants cannot be truncated because truncation creates incorrect double-byte data. Error ASMA28E Truncation into double-byte data is not permitted is issued if such truncation is attempted. 5. Truncation of double-byte data in CU-type and G-type constants is permitted because the length modifier restrictions (see “Subfield 5: Modifier” on page 136) ensure that incorrect double-byte data cannot be created by | truncation. However, truncating bit-length constants may create incorrect | double-byte data. Subfield 1: Duplication Factor The syntax for coding the duplication factor is shown in the subfield format on page 127. You may omit the duplication factor. If specified, it causes the nominal value or multiple nominal values specified in a constant to be generated the number of times indicated by the factor. It is applied after the nominal value or values are 132 HLASM V1R5 Language Reference

DC Instruction assembled into the constant. Symbols used in subfield 1 need not be previously defined. This does not apply to literals. The duplication factor can be specified by an unsigned decimal self-defining term or by an absolute expression enclosed in parentheses. The factor must have a positive value or be equal to zero. Notes: 1. A duplication factor of zero is permitted, except for literals, with the following results: No value is assembled. Alignment is forced according to the type of constant specified, if no length attribute is present (see “Alignment of Constants” on page 129). The length attribute of the symbol naming the constant is established according to the implicitly or explicitly specified length. When the duplication factor is zero, the nominal value may be omitted. The alignment is forced, even if the NOALIGN option is specified. When the duplication factor is zero for a literal, the assembler issues message ASMA67S Illegal duplication factor. 2. If duplication is specified for an address constant whose nominal value contains a location counter reference, the value of the location counter reference is incremented by the length of the constant before each duplication is done (see | “Address Constants—A and Y” on page 153). If the duplication factor is zero, | the value of the location counter reference is not incremented by the length of | each constant that would have been generated for a non-zero duplication | factor. Thus, in each of the following two statements, the first generates an | ASMA072E error message for "Data item too large", but the second does not: | A DC Y(,32768-(-A)) | B DC Y(,32768-(-B)) However, if duplication is specified for an address-type literal constant containing a location counter reference, the value of the location counter reference is not incremented by the length of the literal before each duplication is done. The value of the location counter reference is the location of the first byte of the literal in the literal pool, and is the same for each duplication. The location counter value is that of the instruction in which the literal appears for A-type constants, but for S-type constants it is the location where the literal actually appears. 3. The maximum value for the duplication factor is 2 24 −1, or X'FFFFFF' bytes. If the maximum value for the duplication factor is exceeded, the assembler issues message ASMA67S Illegal duplication factor. Subfield 2: Type The syntax for coding the type is shown in the subfield format on page 127. You must specify the type subfield. From the type specification, the assembler determines how to interpret the constant and translate it into the correct format. The type is specified by a single-letter code as shown in Figure 35, the type extension as shown in Figure 36. Chapter 5. Assembler Instruction Statements 133

DC Instruction<br />

assembled into the constant. Symbols used in subfield 1 need not be previously<br />

defined. This does not apply to literals.<br />

The duplication factor can be specified by an unsigned decimal self-defining term or<br />

by an absolute expression enclosed in parentheses.<br />

The factor must have a positive value or be equal to zero.<br />

Notes:<br />

1. A duplication factor of zero is permitted, except for literals, with the following<br />

results:<br />

No value is assembled.<br />

Alignment is forced according to the type of constant specified, if no length<br />

attribute is present (see “Alignment of Constants” on page 129).<br />

The length attribute of the symbol naming the constant is established<br />

according to the implicitly or explicitly specified length.<br />

When the duplication factor is zero, the nominal value may be omitted. The<br />

alignment is forced, even if the NOALIGN option is specified.<br />

When the duplication factor is zero for a literal, the assembler issues message<br />

ASMA67S Illegal duplication factor.<br />

2. If duplication is specified for an address constant whose nominal value contains<br />

a location counter reference, the value of the location counter reference is<br />

incremented by the length of the constant before each duplication is done (see<br />

| “Address Constants—A and Y” on page 153). If the duplication factor is zero,<br />

| the value of the location counter reference is not incremented by the length of<br />

| each constant that would have been generated for a non-zero duplication<br />

| factor. Thus, in each of the following two statements, the first generates an<br />

| ASMA072E error message for "Data item too large", but the second does not:<br />

| A DC Y(,32768-(-A))<br />

| B DC Y(,32768-(-B))<br />

However, if duplication is specified for an address-type literal constant<br />

containing a location counter reference, the value of the location counter<br />

reference is not incremented by the length of the literal before each duplication<br />

is done. The value of the location counter reference is the location of the first<br />

byte of the literal in the literal pool, and is the same for each duplication.<br />

The location counter value is that of the instruction in which the literal appears<br />

for A-type constants, but for S-type constants it is the location where the literal<br />

actually appears.<br />

3. The maximum value for the duplication factor is 2 24 −1, or X'FFFFFF' bytes. If<br />

the maximum value for the duplication factor is exceeded, the assembler issues<br />

message ASMA67S Illegal duplication factor.<br />

Subfield 2: Type<br />

The syntax for coding the type is shown in the subfield format on page 127.<br />

You must specify the type subfield. From the type specification, the assembler<br />

determines how to interpret the constant and translate it into the correct format.<br />

The type is specified by a single-letter code as shown in Figure 35, the type<br />

extension as shown in Figure 36.<br />

Chapter 5. Assembler Instruction Statements 133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!