HLASM Language Reference
HLASM Language Reference HLASM Language Reference
DC Instruction—Address Constants ACON DC A(18,LOP,END–STRT,+496) LM 4,7,=A(18,LOP,END–STRT,+496) A location counter reference () appears in the fourth constant (+496). 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. 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 Figure 45 on page 157) representing an implicit address. 2. As two absolute expressions (see ▌2▐ in Figure 45) 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 Figure 45, 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. The leftmost four bits of the assembled constant represent the base register designation; the remaining 12 bits, 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: Multiple operands Multiple nominal values A duplication factor 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 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: 156 HLASM V1R5 Language Reference
DC Instruction—Address Constants USING ,15 DC 2S() generates FF2 LA 1,=2S() generated constants are F4F4 Note that this behavior is different from that in A-type address constants and Y-type address constants. Figure 45. S Address Constants Subfield Value Example Result 1. Duplication factor Allowed 2. Type S 3. Type Extension Not allowed | 4. Program type Allowed 5. Modifiers Implicit length: (length modifier not present) Alignment: (Length modifier not present) Range for length: Range for scale: Range for exponent: 6. Nominal value Represented by: 2 bytes Halfword 2 only (no bit length) Not allowed Not allowed Absolute or relocatable expression ▌1▐ DC S(RELOC) DC S(124) Base Disp X YYY 0 400 Enclosed by: Exponent allowed: Number of values per operand: Padding: Truncation of assembled value: Two absolute expressions ▌2▐ Parentheses No Multiple Not applicable Not applicable DC S(512(12)) C 200 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 Chapter 5. Assembler Instruction Statements 157
- Page 126 and 127: ACONTROL Instruction FLAG(PAGE0) in
- Page 128 and 129: AINSERT Instruction character_strin
- Page 130 and 131: AMODE Instruction alias_string is t
- Page 132 and 133: CATTR Instruction Figure 25. AMODE/
- Page 134 and 135: CATTR Instruction | statements for
- Page 136 and 137: CCW1 Instruction data_count is an a
- Page 138 and 139: CEJECT Instruction If symbol is an
- Page 140 and 141: CNOP Instruction Figure 29 (Page 2
- Page 142 and 143: COPY Instruction In the following e
- Page 144 and 145: CSECT Instruction symbol in the nam
- Page 146 and 147: DC Instruction ROUTINE B GAMMA DXD
- Page 148 and 149: DC Instruction duplication_factor c
- Page 150 and 151: DC Instruction Figure 33 (Page 2 of
- Page 152 and 153: DC Instruction With EBCDIC spaces
- Page 154 and 155: DC Instruction Further information
- Page 156 and 157: DC Instruction | Symbols used in su
- Page 158 and 159: DC Instruction The length attribute
- Page 160 and 161: DC Instruction Notes: 1. Don't conf
- Page 162 and 163: DC Instruction—Character Constant
- Page 164 and 165: DC Instruction—Character Constant
- Page 166 and 167: DC Instruction—Graphic Constant r
- Page 168 and 169: DC Instruction—Fixed-Point Consta
- Page 170 and 171: DC Instruction—Fixed-Point Consta
- Page 172 and 173: DC Instruction—Decimal Constants
- Page 174 and 175: DC Instruction—Address Constants
- Page 178 and 179: DC Instruction—Offset Constant re
- Page 180 and 181: DC Instruction—Length Constant Le
- Page 182 and 183: DC Instruction—Hexadecimal Floati
- Page 184 and 185: DC Instruction—Hexadecimal Floati
- Page 186 and 187: DC Instruction—Hexadecimal Floati
- Page 188 and 189: DC Instruction—Binary Floating-Po
- Page 190 and 191: DC Instruction—Binary Floating-Po
- Page 192 and 193: DROP Instruction DROP Instruction T
- Page 194 and 195: DS Instruction USING DSECTA,14 ALBL
- Page 196 and 197: DS Instruction The size of a storag
- Page 198 and 199: DSECT Instruction DSECT Instruction
- Page 200 and 201: DXD Instruction ASEMBLY2 CSECT USIN
- Page 202 and 203: END Instruction change but no addit
- Page 204 and 205: EQU Instruction EQU Instruction The
- Page 206 and 207: EQU Instruction 5. The length attri
- Page 208 and 209: EXITCTL Instruction sequence_symbol
- Page 210 and 211: ISEQ Instruction must be greater th
- Page 212 and 213: LOCTR Instruction A CSECT , See not
- Page 214 and 215: LTORG Instruction If symbol is an o
- Page 216 and 217: MNOTE Instruction When two literals
- Page 218 and 219: OPSYN Instruction ,ERROR, SEV 1 An
- Page 220 and 221: ORG Instruction AFTER is defined in
- Page 222 and 223: ORG Instruction If you specify mult
- Page 224 and 225: POP Instruction POP Instruction The
DC Instruction—Address Constants<br />
USING ,15<br />
DC 2S() generates FF2<br />
LA 1,=2S() generated constants are F4F4<br />
Note that this behavior is different from that in A-type address constants and<br />
Y-type address constants.<br />
Figure 45. S Address Constants<br />
Subfield Value Example Result<br />
1. Duplication factor Allowed<br />
2. Type S<br />
3. Type Extension Not allowed<br />
| 4. Program type Allowed<br />
5. Modifiers<br />
Implicit length:<br />
(length modifier<br />
not present)<br />
Alignment:<br />
(Length modifier<br />
not present)<br />
Range for length:<br />
Range for scale:<br />
Range for exponent:<br />
6. Nominal value<br />
Represented by:<br />
2 bytes<br />
Halfword<br />
2 only<br />
(no bit length)<br />
Not allowed<br />
Not allowed<br />
Absolute or<br />
relocatable<br />
expression ▌1▐<br />
DC S(RELOC)<br />
DC S(124)<br />
Base Disp<br />
X YYY<br />
0 400<br />
Enclosed by:<br />
Exponent allowed:<br />
Number of values<br />
per operand:<br />
Padding:<br />
Truncation of<br />
assembled value:<br />
Two absolute<br />
expressions ▌2▐<br />
Parentheses<br />
No<br />
Multiple<br />
Not applicable<br />
Not applicable<br />
DC S(512(12))<br />
C 200<br />
Address Constant—V: The V-type constant reserves storage for the address of a<br />
location in a control section that is defined in another source module. Use the<br />
V-type address constant only to branch to an external address, because link-time<br />
processing may cause the branch to be indirect (for example, an assisted linkage in<br />
an overlay module). That is, the resolved address in a V-type address constant<br />
might not contain the address of the referenced symbol. In contrast, to refer to<br />
external data you should use an A-type address constant whose nominal value<br />
specifies an external symbol identified by an EXTRN instruction.<br />
Because you specify a symbol in a V-type address constant, the assembler<br />
assumes that it is an external symbol. A value of zero is assembled into the space<br />
Chapter 5. Assembler Instruction Statements 157