HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Prototype Statement Macros that are defined inline may use any ordinary symbol, up to 63 characters in length, for the operation field. However, operating system rules may prevent some of these macros from being stored as member names. The assembler requires that the library member name and macro name be the same; otherwise error diagnostic message ASMA126S Library macro name incorrect is issued. symbolic_parameter The symbolic parameters are used in the macro definition to represent the operands of the corresponding macro instruction. A description of symbolic parameters appears under “Symbolic Parameters” on page 253. The operand field in a prototype statement lets you specify positional or keyword parameters. These parameters represent the values you can pass from the calling macro instruction to the statements within the body of a macro definition. The operand field of the macro prototype statement must contain 0 to 32000 symbolic parameters separated by commas. They can be positional parameters or keyword parameters, or both. If no parameters are specified in the operand field and if the absence of the operand entry is indicated by a comma preceded and followed by one or more spaces, remarks are allowed. The following is an example of a prototype statement: &NAME MOVE &TO,&FROM Alternative Formats for the Prototype Statement The prototype statement can be specified in one of the following three ways: The normal way, with all the symbolic parameters preceding any remarks An alternative way, allowing remarks for each parameter A combination of the first two ways The continuation rules for macro instructions are different from those for machine or assembler instruction statements. This difference is important for those who write macros that override a machine/assembler mnemonic. The following examples show the normal statement format (&NAME1), the alternative statement format (&NAME2), and a combination of both statement formats (&NAME3): Opera- Name tion Operand Comment Cont. &NAME1 OP1 &OPERAND1,&OPERAND2,&OPERAND3 This is the normal X statement format &NAME2 OP2 &OPERAND1, This is the alter- X &OPERAND2 native statement format &NAME3 OP3 &OPERAND1, This is a combination X &OPERAND2,&OPERAND3, of both X &OPERAND4 246 HLASM V1R5 Language Reference
Body of a Macro Definition Notes: 1. Any number of continuation lines is allowed. However, each continuation line must be indicated by a non-space character in the column after the end column on the preceding line. 2. For each continuation line, the operand field entries (symbolic parameters) must begin in the continue column; otherwise, the whole line and any lines that follow are considered to contain remarks. No error diagnostic message is issued to indicate that operands are treated as remarks in this situation. However, the FLAG(CONT) assembler option can be specified so that the assembler issues warning messages if it suspects an error in a continuation line. 3. The standard value for the continue column is 16 and the standard value for the end column is 71. 4. A comma is required after each parameter except the last. If you code excess commas between parameters, they are considered null positional parameters. No error diagnostic message is issued. 5. One or more spaces is required between the operand and the remarks. 6. If the DBCS assembler option is specified, the continuation features outlined in “Continuation of double-byte data” on page 16 apply to continuation in the macro language. Extended continuation may be useful if a macro keyword parameter contains double-byte data. Body of a Macro Definition The body of a macro definition contains the sequence of statements that constitutes the working part of a macro. You can specify: Model statements to be generated Processing statements that, for example, can alter the content and sequence of the statements generated or issue error messages Comment statements, some that are generated and others that are not Conditional assembly instructions to compute results to be displayed in the message created by the MNOTE instruction, without causing any assembler language statements to be generated The statements in the body of a macro definition must appear between the macro prototype statement and the MEND statement of the definition. The body of a macro definition can be empty, that is, contain no statements. Nesting Macros: You can include macro definitions in the body of a macro definition. Model Statements Model statements are statements from which assembler language statements are generated during conditional assembly. They let you determine the form of the statements to be generated. By specifying variable symbols as points of substitution in a model statement, you can vary the contents of the statements Chapter 7. How to Specify Macro Definitions 247
- 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 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 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
- Page 310 and 311: &SYSPUNCH_MEMBER System Variable Sy
- Page 312 and 313: &SYSSTEP System Variable Symbol Not
- Page 314 and 315: &SYSTERM_DSN System Variable Symbol
Body of a Macro Definition<br />
Notes:<br />
1. Any number of continuation lines is allowed. However, each continuation line<br />
must be indicated by a non-space character in the column after the end column<br />
on the preceding line.<br />
2. For each continuation line, the operand field entries (symbolic parameters) must<br />
begin in the continue column; otherwise, the whole line and any lines that<br />
follow are considered to contain remarks.<br />
No error diagnostic message is issued to indicate that operands are<br />
treated as remarks in this situation. However, the FLAG(CONT) assembler<br />
option can be specified so that the assembler issues warning messages if<br />
it suspects an error in a continuation line.<br />
3. The standard value for the continue column is 16 and the standard value for<br />
the end column is 71.<br />
4. A comma is required after each parameter except the last. If you code excess<br />
commas between parameters, they are considered null positional parameters.<br />
No error diagnostic message is issued.<br />
5. One or more spaces is required between the operand and the remarks.<br />
6. If the DBCS assembler option is specified, the continuation features outlined in<br />
“Continuation of double-byte data” on page 16 apply to continuation in the<br />
macro language. Extended continuation may be useful if a macro keyword<br />
parameter contains double-byte data.<br />
Body of a Macro Definition<br />
The body of a macro definition contains the sequence of statements that constitutes<br />
the working part of a macro. You can specify:<br />
Model statements to be generated<br />
Processing statements that, for example, can alter the content and sequence of<br />
the statements generated or issue error messages<br />
Comment statements, some that are generated and others that are not<br />
Conditional assembly instructions to compute results to be displayed in the<br />
message created by the MNOTE instruction, without causing any assembler<br />
language statements to be generated<br />
The statements in the body of a macro definition must appear between the macro<br />
prototype statement and the MEND statement of the definition. The body of a<br />
macro definition can be empty, that is, contain no statements.<br />
Nesting Macros: You can include macro definitions in the body of a macro<br />
definition.<br />
Model Statements<br />
Model statements are statements from which assembler language statements are<br />
generated during conditional assembly. They let you determine the form of the<br />
statements to be generated. By specifying variable symbols as points of<br />
substitution in a model statement, you can vary the contents of the statements<br />
Chapter 7. How to Specify Macro Definitions 247