HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Introduction to Macro Language The three types of variable symbols in the assembler language are: Symbolic parameters, declared in the prototype statement System variable symbols SET symbols, which are part of the conditional assembly language The assembler processes the generated statements, with or without value substitution, at assembly time. Processing Statements Processing statements are processed during conditional assembly, when macros are expanded, but they are not themselves generated for further processing at assembly time. The processing statements are: AEJECT instructions AREAD instructions ASPACE instructions Conditional assembly instructions Inner macro calls MEXIT instructions MNOTE instructions The AEJECT and ASPACE instructions let you control the listing of your macro definition. Use the AEJECT instruction to stop printing the listing on the current page and continue printing on the next. Use the ASPACE instruction to insert blank lines in the listing. The AEJECT instruction is described on page 257. The ASPACE instruction is described on page 259. The AREAD instruction assigns a character string value, of a statement that is placed immediately after a macro instruction, to a SETC symbol. The AREAD instruction is described on page 257. Conditional assembly instructions, inner macro calls, and macro processing instructions are described in detail in the following chapters. The MNOTE instruction generates an error message with an error condition code attached, or generates comments in which you can display the results of a conditional assembly computation. The MNOTE instruction is described on page 196. The MEND statement delimits the contents of a macro definition, and also provides an exit from the definition. The MEND instruction is described on page 245. The MEXIT instruction tells the assembler to stop processing a macro definition, and provides an exit from the macro definition at a point before the MEND statement. The MEXIT instruction is described on page 260. Comment Statements One type of comment statement describes conditional assembly operations and is not generated. The other type describes assembly-time operations and is, therefore, generated. For a description of the two types of comment statements, see “Comment Statements” on page 261. 240 HLASM V1R5 Language Reference
Introduction to Macro Language Macro Instruction A macro instruction is a source program statement that you code to tell the assembler to process a particular macro definition. The assembler generates a sequence of assembler language statements for each occurrence of the same macro instruction. The generated statements are then processed as any other assembler language statement. The macro instruction provides the assembler with: The name of the macro definition to be processed. The information or values to be passed to the macro definition. The assembler uses the information either in processing the macro definition or for substituting values into a model statement in the definition. The output from a macro definition, called by a macro instruction, can be: A sequence of statements generated from the model statements of the macro for further processing at assembly time. Values assigned to global SET symbols. These values can be used in other macro definitions and in open code. You can call a macro definition by specifying a macro instruction anywhere in a source module. You can also call a macro definition from within another macro definition. This type of call is an inner macro call; it is said to be nested in the macro definition. Source and Library Macro Definitions You can include a macro definition in a source module. This type of definition is called a source macro definition, or, sometimes, an in-line macro definition. You can also insert a macro definition into a system or user library by using the applicable utility program. This type of definition is called a library macro definition. The IBM-supplied macro definitions are examples of library macro definitions. You can call a source macro definition only from the source module in which it is included. You can call a library macro definition from any source module if the library containing the macro definition is available to the assembler. Syntax errors in processing statements are handled differently for source macro definitions and library macro definitions. In source macro definitions, error messages are listed following the statements in error. In library macros, however, error messages cannot be associated with the statement in error, because the statements in library macro definitions are not included in the assembly listing. Therefore, the error messages are listed directly following the first call of that macro. Because of the difficulty of finding syntax errors in library macros, a macro definition should be run and “debugged” as a source macro before it is placed in a macro library. Alternatively, you can use the LIBMAC assembler option to have the assembler automatically include the source statements of the library macro in your source module. For more information about the LIBMAC option, see the HLASM Programmer's Guide. Chapter 6. Introduction to Macro Language 241
- 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
- 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 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
- Page 270 and 271: Model Statements ▌5▐ ▌6▐
- Page 272 and 273: Model Statements Notes: 1. You can
- Page 274 and 275: Positional Parameters Symbolic para
- Page 276 and 277: Processing Statements Processing St
- Page 278 and 279: AREAD Instruction Assign Local Time
- Page 280 and 281: COPY Instruction sequence_symbol is
- Page 282 and 283: System Variable Symbols System Vari
- Page 284 and 285: &SYSADATA_MEMBER System Variable Sy
- Page 286 and 287: &SYSCLOCK System Variable Symbol &S
- Page 288 and 289: &SYSECT System Variable Symbol depe
- Page 290 and 291: &SYSIN_MEMBER System Variable Symbo
- Page 292 and 293: &SYSJOB System Variable Symbol &SYS
- Page 294 and 295: &SYSLIN_DSN System Variable Symbol
- Page 296 and 297: &SYSLIST System Variable Symbol The
- Page 298 and 299: &SYSLOC System Variable Symbol To
- Page 300 and 301: &SYSM_SEV System Variable Symbol &S
- Page 302 and 303: &SYSNDX System Variable Symbol The
- Page 304 and 305: &SYSOPT_DBCS System Variable Symbol
- Page 306 and 307: &SYSPARM System Variable Symbol Not
- Page 308 and 309: &SYSPRINT_MEMBER System Variable Sy
Introduction to Macro <strong>Language</strong><br />
The three types of variable symbols in the assembler language are:<br />
Symbolic parameters, declared in the prototype statement<br />
System variable symbols<br />
SET symbols, which are part of the conditional assembly language<br />
The assembler processes the generated statements, with or without value<br />
substitution, at assembly time.<br />
Processing Statements<br />
Processing statements are processed during conditional assembly, when macros<br />
are expanded, but they are not themselves generated for further processing at<br />
assembly time. The processing statements are:<br />
AEJECT instructions<br />
AREAD instructions<br />
ASPACE instructions<br />
Conditional assembly instructions<br />
Inner macro calls<br />
MEXIT instructions<br />
MNOTE instructions<br />
The AEJECT and ASPACE instructions let you control the listing of your macro<br />
definition. Use the AEJECT instruction to stop printing the listing on the current<br />
page and continue printing on the next. Use the ASPACE instruction to insert<br />
blank lines in the listing. The AEJECT instruction is described on page 257. The<br />
ASPACE instruction is described on page 259.<br />
The AREAD instruction assigns a character string value, of a statement that is<br />
placed immediately after a macro instruction, to a SETC symbol. The AREAD<br />
instruction is described on page 257.<br />
Conditional assembly instructions, inner macro calls, and macro processing<br />
instructions are described in detail in the following chapters.<br />
The MNOTE instruction generates an error message with an error condition code<br />
attached, or generates comments in which you can display the results of a<br />
conditional assembly computation. The MNOTE instruction is described on page<br />
196.<br />
The MEND statement delimits the contents of a macro definition, and also provides<br />
an exit from the definition. The MEND instruction is described on page 245.<br />
The MEXIT instruction tells the assembler to stop processing a macro definition,<br />
and provides an exit from the macro definition at a point before the MEND<br />
statement. The MEXIT instruction is described on page 260.<br />
Comment Statements<br />
One type of comment statement describes conditional assembly operations and is<br />
not generated. The other type describes assembly-time operations and is,<br />
therefore, generated. For a description of the two types of comment statements,<br />
see “Comment Statements” on page 261.<br />
240 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>