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 | Symbols used in subfield 4 need not be previously defined, except in literals. For | example: | SYM DC FP(Rate5)'35.92' | Rate5 EQU 5 | All expressions in program type must be evaluatable when the DC is processed. | If program type is omitted, the assembler assigns a null to the program type, and | querying the value using the SYSATTRP build-in function returns a null value. Subfield 5: Modifier The syntax for coding the modifier is shown in the subfield format on page 127. You may omit the modifier subfield. Modifiers describe the length in bits or bytes you want for a constant (in contrast to an implied length), and the scaling and exponent for the constant. The three modifiers are: The length modifier (L), that explicitly defines the length in bytes you want for a constant. For example: LENGTH DC XL1'FF' The scale modifier (S), that is only used with the fixed-point or floating-point constants (for details, see “Scale Modifier” on page 138). For example: SCALE DC FS8'35.92' The exponent modifier (E), that is only used with fixed-point or floating-point constants, and indicates the power of 10 by which the constant is to be multiplied before conversion to its internal binary format. For example: EXPON DC EE3'3.414' If multiple modifiers are used, they must appear in this sequence: length, scale, and exponent. For example: ALL3 DC DL7S3E5'2.7182' Symbols used in subfield 5 need not be previously defined, except in literals. For example: SYM DC FS(X)'35.92' X EQU 7 Length Modifier The length modifier indicates the number of bytes of storage into which the constant is to be assembled. It is written as Ln, where n is either a decimal self-defining term or an absolute expression enclosed by parentheses. It must have a positive value. When the length modifier is specified: Its value determines the number of bytes of storage allocated to a constant. It therefore determines whether the nominal value of a constant must be padded or truncated to fit into the space allocated (see “Padding and Truncation of Values” on page 130). 136 HLASM V1R5 Language Reference

DC Instruction No boundary alignment, according to constant type, is provided (see “Alignment of Constants” on page 129). Its value must not exceed the maximum length allowed for the various types of constant defined. | The length modifier must not truncate double-byte data in a C-type constant, | except for bit-length modifiers. The length modifier must be a multiple of 2 in a G-type or CU-type constant. When no length is specified, for character and graphic constants (C and G), hexadecimal constants (X), binary constants (B), and decimal constants (P and Z), the whole constant is assembled into its implicit length. Bit-Length Modifier: The length modifier can be specified to indicate the number of bits into which a constant is to be assembled. The bit-length modifier is written as L.n where n is either a decimal self-defining term, or an absolute expression enclosed in parentheses. It must have a positive value. Such a modifier is sometimes called a “bit-length” modifier, to distinguish it from a “byte-length” modifier. You may not combine byte-length and bit-length modifiers. For example, a 12-bit field must be written L.12, not L1.4. The value of n must lie between 1 and the number of bits (a multiple of 8) that are required to make up the maximum number of bytes allowed in the type of constant being defined. The bit-length modifier can never be used with the CU-, G-, S-, V-, R-, J- and Q-type constants, and cannot be used with the A-type or Y-type constant if the operand is simply or complexly relocatable. When only one operand and one nominal value are specified in a DC instruction, the following rules apply: 1. The bit-length modifier allocates a field into which a constant is to be assembled. The field starts at a byte boundary and can run over one or more byte boundaries, if the bit length is greater than 8. If the field does not end at a byte boundary and if the bit length is not a multiple of 8, the remainder of the last byte is filled with binary zeros. For example, DC FL.12'-1' generates X'FFF'. 2. The nominal value of the constant is assembled into the field: a. Starting at the high order end for the C-, E-, D-, and L-type constants b. Starting at the low-order end for the remaining types of constants that support a bit-length modifier 3. The nominal value is padded or truncated to fit the field (see “Padding and Truncation of Values” on page 130). | Note that “padding” is not the same as “filling.” In padding, the designated bit | field is completed according to the rules for the constant type. Filling is always | binary zeros placed at the right end of an incomplete byte. | C-type character constants are padded with EBCDIC spaces (hexadecimal | X'40', and CA-type character constants are padded with ASCII spaces | (hexadecimal X'20'). Other constant types are padded either by sign | extension or with zeros, according to the type of the constant. Chapter 5. Assembler Instruction Statements 137

DC Instruction<br />

No boundary alignment, according to constant type, is provided (see “Alignment<br />

of Constants” on page 129).<br />

Its value must not exceed the maximum length allowed for the various types of<br />

constant defined.<br />

| The length modifier must not truncate double-byte data in a C-type constant,<br />

| except for bit-length modifiers.<br />

The length modifier must be a multiple of 2 in a G-type or CU-type constant.<br />

When no length is specified, for character and graphic constants (C and G),<br />

hexadecimal constants (X), binary constants (B), and decimal constants (P and Z),<br />

the whole constant is assembled into its implicit length.<br />

Bit-Length Modifier: The length modifier can be specified to indicate the number<br />

of bits into which a constant is to be assembled. The bit-length modifier is written<br />

as L.n where n is either a decimal self-defining term, or an absolute expression<br />

enclosed in parentheses. It must have a positive value. Such a modifier is<br />

sometimes called a “bit-length” modifier, to distinguish it from a “byte-length”<br />

modifier. You may not combine byte-length and bit-length modifiers. For example, a<br />

12-bit field must be written L.12, not L1.4.<br />

The value of n must lie between 1 and the number of bits (a multiple of 8) that are<br />

required to make up the maximum number of bytes allowed in the type of constant<br />

being defined. The bit-length modifier can never be used with the CU-, G-, S-, V-,<br />

R-, J- and Q-type constants, and cannot be used with the A-type or Y-type constant<br />

if the operand is simply or complexly relocatable.<br />

When only one operand and one nominal value are specified in a DC instruction,<br />

the following rules apply:<br />

1. The bit-length modifier allocates a field into which a constant is to be<br />

assembled. The field starts at a byte boundary and can run over one or more<br />

byte boundaries, if the bit length is greater than 8.<br />

If the field does not end at a byte boundary and if the bit length is not a<br />

multiple of 8, the remainder of the last byte is filled with binary zeros. For<br />

example, DC FL.12'-1' generates X'FFF'.<br />

2. The nominal value of the constant is assembled into the field:<br />

a. Starting at the high order end for the C-, E-, D-, and L-type constants<br />

b. Starting at the low-order end for the remaining types of constants that<br />

support a bit-length modifier<br />

3. The nominal value is padded or truncated to fit the field (see “Padding and<br />

Truncation of Values” on page 130).<br />

| Note that “padding” is not the same as “filling.” In padding, the designated bit<br />

| field is completed according to the rules for the constant type. Filling is always<br />

| binary zeros placed at the right end of an incomplete byte.<br />

| C-type character constants are padded with EBCDIC spaces (hexadecimal<br />

| X'40', and CA-type character constants are padded with ASCII spaces<br />

| (hexadecimal X'20'). Other constant types are padded either by sign<br />

| extension or with zeros, according to the type of the constant.<br />

Chapter 5. Assembler Instruction Statements 137

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

Saved successfully!

Ooh no, something went wrong!