HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Macro Instruction Format sequence_symbol is a sequence symbol. If a sequence symbol is coded in the name entry of a macro instruction, the value of the symbol is not passed to the called macro definition and therefore cannot be used as a value for substitution in the macro definition. operation_code is the symbolic operation code which identifies the macro definition that you want the assembler to process. For more information, see “Operation Entry” on page 299. operand The positional operands or keyword operands that you use to pass values into the called macro definition. For more information, see “Operand Entry” on page 300. If no operands 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 entries in the name, operation, and operand fields correspond to entries in the prototype statement of the called macro definition (see “Macro Instruction Prototype” on page 245). Alternative Formats for a Macro Instruction A macro instruction can be specified in one of the three following ways: The normal way, with the operands preceding any remarks The alternative way, allowing remarks for each operand A combination of the first two ways The following example 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 Notes: 1. Any number of continuation lines are allowed. However, each continuation line must be indicated by a non-space character in the column after the end column of the previous statement line (see “Continuation Lines” on page 15). 2. 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 operand contains double-byte data. 298 HLASM V1R5 Language Reference
Macro Instruction Format 3. Operands on continuation lines must begin in the continue column (column 16), or the assembler assumes that the current line and any lines that follow contain remarks. If any entries are made in the columns before the continue column in continuation lines, the assembler issues an error message and the whole statement is not processed. 4. One or more spaces must separate the operand from the remarks. 5. A comma after an operand indicates more operands follow. 6. The last operand requires no comma following it, but using a comma does not cause an error. 7. You do not need to use the same format when you code a macro instruction as you use when you code the corresponding macro prototype statement. 8. Continued comments for a macro with an operand list that terminates in a null operand will be recognized provided each continued comment begins in the same or later column as the preceding line's comment. Name Entry Use the name entry of a macro instruction to: Pass a value into a macro definition through the name entry declared in the macro definition Provide a conditional assembly label (see “Sequence Symbols” on page 339) so that you can branch to the macro instruction during conditional assembly if you want the called macro definition expanded. The name entry of a macro instruction can be: Space An ordinary symbol, such as HERE A variable symbol, such as &A. Any combination of variable symbols and other character strings concatenated together, such as HERE.&A Any character string allowed in a macro instruction operand, such as 'Now is the hour' or STRING, excluding sublist entries and certain attribute references (see “Values in Operands” on page 307) A sequence symbol, which is not passed to the macro definition, such as .SEQ Operation Entry The operation entry is the symbolic name of the operation code that identifies a macro definition to process. The operation entry must be a valid symbol, and must be identical to the operation field in the prototype statement of the macro definition. The assembler searches for source macro definitions before library macro definitions. If you have a source macro definition that has the same name as a library macro definition, the assembler only processes the source macro definition. Chapter 8. How to Write Macro Instructions 299
- 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
- Page 316 and 317: &SYSTIME System Variable Symbol Not
- Page 320 and 321: Macro Instruction Format Operand En
- Page 322 and 323: Macro Instruction Format When you n
- Page 324 and 325: Sublists in Operands the order in w
- Page 326 and 327: Sublists in Operands &SYSLIST( n,m)
- Page 328 and 329: Values in Operands Notes: 1. Spaces
- Page 330 and 331: Values in Operands Parentheses In m
- Page 332 and 333: Inner and Outer Macro Instructions
- Page 334 and 335: Levels of Macro Call Nesting When t
- Page 336 and 337: Levels of Macro Call Nesting System
- Page 338 and 339: How to Write Conditional Assembly I
- Page 340 and 341: SET Symbols SET Symbol Specificatio
- Page 342 and 343: SET Symbols Figure 86 (Page 3 of 3)
- Page 344 and 345: Data Attributes this example indica
- Page 346 and 347: Data Attributes variable_symbol is
- Page 348 and 349: Data Attributes The value of an att
- Page 350 and 351: Data Attributes The following attri
- Page 352 and 353: Data Attributes Assembler gives a t
- Page 354 and 355: Data Attributes The scale attribute
- Page 356 and 357: Data Attributes Number Attribute (N
- Page 358 and 359: Data Attributes The operation code
- Page 360 and 361: Lookahead MACRO &NAME MOVE &TO,&FRO
- Page 362 and 363: Open Code Sequence Symbols The cond
- Page 364 and 365: GBLA, GBLB, and GBLC Instructions G
- Page 366 and 367: LCLA, LCLB, and LCLC Instructions s
Macro Instruction Format<br />
3. Operands on continuation lines must begin in the continue column (column 16),<br />
or the assembler assumes that the current line and any lines that follow contain<br />
remarks.<br />
If any entries are made in the columns before the continue column in<br />
continuation lines, the assembler issues an error message and the whole<br />
statement is not processed.<br />
4. One or more spaces must separate the operand from the remarks.<br />
5. A comma after an operand indicates more operands follow.<br />
6. The last operand requires no comma following it, but using a comma does not<br />
cause an error.<br />
7. You do not need to use the same format when you code a macro instruction as<br />
you use when you code the corresponding macro prototype statement.<br />
8. Continued comments for a macro with an operand list that terminates in a null<br />
operand will be recognized provided each continued comment begins in the<br />
same or later column as the preceding line's comment.<br />
Name Entry<br />
Use the name entry of a macro instruction to:<br />
Pass a value into a macro definition through the name entry declared in the<br />
macro definition<br />
Provide a conditional assembly label (see “Sequence Symbols” on page 339)<br />
so that you can branch to the macro instruction during conditional assembly if<br />
you want the called macro definition expanded.<br />
The name entry of a macro instruction can be:<br />
Space<br />
An ordinary symbol, such as HERE<br />
A variable symbol, such as &A.<br />
Any combination of variable symbols and other character strings concatenated<br />
together, such as HERE.&A<br />
Any character string allowed in a macro instruction operand, such as 'Now is<br />
the hour' or STRING, excluding sublist entries and certain attribute references<br />
(see “Values in Operands” on page 307)<br />
A sequence symbol, which is not passed to the macro definition, such as .SEQ<br />
Operation Entry<br />
The operation entry is the symbolic name of the operation code that identifies a<br />
macro definition to process.<br />
The operation entry must be a valid symbol, and must be identical to the operation<br />
field in the prototype statement of the macro definition.<br />
The assembler searches for source macro definitions before library macro<br />
definitions. If you have a source macro definition that has the same name as a<br />
library macro definition, the assembler only processes the source macro definition.<br />
Chapter 8. How to Write Macro Instructions 299