HLASM Language Reference
HLASM Language Reference HLASM Language Reference
ORG Instruction AFTER is defined in COPYBOOK, the following code gives an ASMA042E error (Length attribute of symbol is unavailable): AIF (L'AFTER LT 2).BEYOND OPCOPY OPSYN COPY OPSYN not processed during look ahead OPCOPY COPYBOOK OPCOPY fails .BEYOND ANOP , Redefining Conditional Assembly Instructions A redefinition of a conditional assembly instruction only comes into effect in macro definitions occurring after the OPSYN instruction. The original definition is always used when a macro instruction calls a macro that was defined and edited before the OPSYN instruction. An OPSYN instruction that redefines the operation code of an assembler or machine instruction generated from a macro instruction is, however, effective immediately, even if the definition of the macro was made prior to the OPSYN instruction. Consider the following example: MACRO Macro header MAC ... Macro prototype AIF ... MVC ... . MEND Macro trailer . AIF OPSYN AGO Assign AGO properties to AIF MVC OPSYN MVI Assign MVI properties to MVC . MAC ... Macro call (AIF interpreted as AIF instruction; generated AIFs not printed) + MVC ... Interpreted as MVI instruction . . Open code started at this point AIF ... Interpreted as AGO instruction MVC ... Interpreted as MVI instruction In this example, AIF and MVC instructions are used in a macro definition. AIF is a conditional assembly instruction, and MVC is a machine instruction. OPSYN instructions are used to assign the properties of AGO to AIF and to assign the properties of MVI to MVC. In subsequent calls of the macro MAC, AIF is still defined, and used, as an AIF operation, but the generated MVC is treated as an MVI operation. In open code following the macro call, the operations of both instructions are derived from their new definitions assigned by the OPSYN instructions. If the macro is redefined (by another macro definition), the new definitions of AIF and MVC (that is, AGO and MVI) are used for further generations. ORG Instruction The ORG instruction alters the setting of the location counter and thus controls the structure of the current control section. This redefines portions of a control section. If a control section has not been previously established, ORG will initiate an unnamed (private) control section. 200 HLASM V1R5 Language Reference
ORG Instruction ►►──┬────────┬──ORG─────────────────────────────────────────────────► └─symbol─┘ ►──┬────────────────────────────────────────────────┬──────────────►◄ | └─expression──┬────────────────────────────────┬─┘ | └─,──┬─boundary──┬───────────┬─┬─┘ | │ └─,──offset─┘ │ | └─,──offset───────────────┘ symbol is one of the following: An ordinary symbol A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol A sequence symbol If symbol denotes an ordinary symbol, the ordinary symbol is defined with the value that the location counter had before the ORG statement is processed. expression is a relocatable expression, the value of which is used to set the location counter. If expression is omitted, the location counter is set to the next available location for the current control section. | boundary | is an absolute expression that must be a power of 2 with a range from 8 | (doubleword) to 4096 (page). If boundary exceeds the SECTALGN value, | message ASMA500E is issued. | offset | Any absolute expression | If boundary or offset are provided, then the resultant location counter is calculated | by rounding the expression up to the next higher boundary and then adding the | offset value. In general, symbols used in expression need not have been previously defined. However, the relocatable component of expression (that is, the unpaired relocatable term) must have been previously defined in the same control section in which the ORG statement appears, or be equated to a previously defined value. A length attribute reference to the name of a ORG instruction is always invalid. Message ASMS042E is issued, and a default value of 1 is assigned. An ORG statement cannot be used to specify a location below the beginning of the control section in which it appears. For example, the following statement is not correct if it appears less than 500 bytes from the beginning of the current control section. ORG –5 This is because the expression specified is negative, and sets the location counter to a value larger than the assembler can process. The location counter wraps around (the location counter is discussed in detail in “Location Counter” on page 36). Chapter 5. Assembler Instruction Statements 201
- 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 176 and 177: 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 222 and 223: ORG Instruction If you specify mult
- Page 224 and 225: POP Instruction POP Instruction The
- Page 226 and 227: PRINT Instruction Note: If the next
- Page 228 and 229: Process Statement Process Statement
- Page 230 and 231: REPRO Instruction NOPRINT instructs
- Page 232 and 233: RSECT Instruction 4. AMODE or RMODE
- Page 234 and 235: START Instruction START Instruction
- Page 236 and 237: TITLE Instruction The name value is
- Page 238 and 239: USING Instruction Only the characte
- Page 240 and 241: USING Instruction Base Registers fo
- Page 242 and 243: USING Instruction If register 0 is
- Page 244 and 245: USING Instruction A variable symbo
- Page 246 and 247: USING Instruction In this MVC instr
- Page 248 and 249: USING Instruction Range of a Depend
- Page 250 and 251: XATTR Instruction external_symbol i
- Page 252 and 253: XATTR Instruction SCOPE ►►─
- Page 254 and 255: XATTR Instruction 234 HLASM V1R5 La
- Page 256 and 257: Part 3. Macro Language &SYSDATC Sys
- Page 258 and 259: Introduction to Macro Language Chap
- Page 260 and 261: Introduction to Macro Language The
- Page 262 and 263: Introduction to Macro Language Macr
- Page 264 and 265: MACRO and MEND Statements The assem
- Page 266 and 267: Prototype Statement Macros that are
- Page 268 and 269: Model Statements generated from tha
ORG Instruction<br />
AFTER is defined in COPYBOOK, the following code gives an ASMA042E error<br />
(Length attribute of symbol is unavailable):<br />
AIF (L'AFTER LT 2).BEYOND<br />
OPCOPY OPSYN COPY OPSYN not processed during look ahead<br />
OPCOPY COPYBOOK<br />
OPCOPY fails<br />
.BEYOND ANOP ,<br />
Redefining Conditional Assembly Instructions<br />
A redefinition of a conditional assembly instruction only comes into effect in macro<br />
definitions occurring after the OPSYN instruction. The original definition is always<br />
used when a macro instruction calls a macro that was defined and edited before<br />
the OPSYN instruction.<br />
An OPSYN instruction that redefines the operation code of an assembler or<br />
machine instruction generated from a macro instruction is, however, effective<br />
immediately, even if the definition of the macro was made prior to the OPSYN<br />
instruction. Consider the following example:<br />
MACRO<br />
Macro header<br />
MAC ... Macro prototype<br />
AIF ...<br />
MVC ...<br />
.<br />
MEND<br />
Macro trailer<br />
.<br />
AIF OPSYN AGO Assign AGO properties to AIF<br />
MVC OPSYN MVI Assign MVI properties to MVC<br />
.<br />
MAC ... Macro call<br />
(AIF interpreted as AIF instruction;<br />
generated AIFs not printed)<br />
+ MVC ... Interpreted as MVI instruction<br />
.<br />
. Open code started at this point<br />
AIF ... Interpreted as AGO instruction<br />
MVC ... Interpreted as MVI instruction<br />
In this example, AIF and MVC instructions are used in a macro definition. AIF is a<br />
conditional assembly instruction, and MVC is a machine instruction. OPSYN<br />
instructions are used to assign the properties of AGO to AIF and to assign the<br />
properties of MVI to MVC. In subsequent calls of the macro MAC, AIF is still<br />
defined, and used, as an AIF operation, but the generated MVC is treated as an<br />
MVI operation. In open code following the macro call, the operations of both<br />
instructions are derived from their new definitions assigned by the OPSYN<br />
instructions. If the macro is redefined (by another macro definition), the new<br />
definitions of AIF and MVC (that is, AGO and MVI) are used for further generations.<br />
ORG Instruction<br />
The ORG instruction alters the setting of the location counter and thus controls the<br />
structure of the current control section. This redefines portions of a control section.<br />
If a control section has not been previously established, ORG will initiate an<br />
unnamed (private) control section.<br />
200 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>