HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Levels of Macro Call Nesting When the assembler processes a macro exit instruction, either MEXIT or MEND, it selects the next statement to process depending on the level of nesting. If the macro exit instruction is from an inner macro, the assembler processes the next statement after the statement that called the outer macro. The next statement in open code might come from the AINSERT buffer. If the macro exit instruction is from an outer macro, the assembler processes the next statement in open code, after the statement that called the inner macro. Passing Values through Nesting Levels The value contained in an outer macro instruction operand can be passed through one or more levels of nesting (see Figure 85 on page 315). However, the value specified (see ▌1▐ in Figure 85) in the inner macro instruction operand must be identical to the corresponding symbolic parameter (see ▌2▐ in Figure 85) declared in the prototype of the containing macro definition. Thus, a sublist can be passed (see ▌3▐ in Figure 85) and referred to (see ▌4▐ in Figure 85) as a sublist in the macro definition called by the inner macro call. Also, any symbol (see ▌5▐ in Figure 85) that is passed carries its attribute values through the nesting levels. If inner macro calls at each level are specified with symbolic parameters as operand values, values can be passed from open code through several levels of macro nesting. COMPAT(SYSLIST) Assembler Option: If the COMPAT(SYSLIST) assembler option is specified, and a symbolic parameter is only a part of the value specified in an inner macro instruction operand, only the character string value given to the parameter by an outer call is passed through the nesting level. Inner sublist entries are, therefore, not available for reference in the inner macro. 314 HLASM V1R5 Language Reference
Levels of Macro Call Nesting ▌2▐ MACRO ┌────┴────┐ OUTER &P1,&P2,&P3 . . . INNER &P1,&P2,&P3 . └────┬────┘ . ▌1▐ . MEND MACRO INNER &Q,&R,&S . . ┐ L 3,&Q(1) │ A 3,&Q(2) ├ ▌4▐ ST 3,&Q(3) │ . ┘ . MVC &R,&S . . MEND ──────────────────────────────────────────────────────────────── START . ▌5▐ . ┌──┴──┐ OUTER (AREA,F2,SUM),TO,FROM . └──────┬──────┘ . ▌3▐ . + L 3,AREA + A 2,F2 + ST 3,SUM . . + MVC TO,FROM . . END Notes: 1. The following inner macro call statement is generated, but not listed unless the PCONTROL(MCALL) option is specified, or the assembler instruction ACONTROL MCALL is active: INNER (AREA,F2,SUM),TO,FROM Figure 85. Passing Values Through Nesting Levels Chapter 8. How to Write Macro Instructions 315
- 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 318 and 319: Macro Instruction Format sequence_s
- 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 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
- Page 368 and 369: SETA Instruction expression is an a
- Page 370 and 371: SETA Instruction | The logical-exp
- Page 372 and 373: SETA Instruction | Figure 99 (Page
- Page 374 and 375: SETA Instruction | The result of C2
- Page 376 and 377: SETA Instruction NOT Format: Logica
- Page 378 and 379: SETA Instruction | X2A Name Operati
- Page 380 and 381: SETA Instruction In evaluating the
- Page 382 and 383: SETB Instruction Any expression tha
Levels of Macro Call Nesting<br />
When the assembler processes a macro exit instruction, either MEXIT or MEND, it<br />
selects the next statement to process depending on the level of nesting. If the<br />
macro exit instruction is from an inner macro, the assembler processes the next<br />
statement after the statement that called the outer macro. The next statement in<br />
open code might come from the AINSERT buffer. If the macro exit instruction is<br />
from an outer macro, the assembler processes the next statement in open code,<br />
after the statement that called the inner macro.<br />
Passing Values through Nesting Levels<br />
The value contained in an outer macro instruction operand can be passed through<br />
one or more levels of nesting (see Figure 85 on page 315). However, the value<br />
specified (see ▌1▐ in Figure 85) in the inner macro instruction operand must be<br />
identical to the corresponding symbolic parameter (see ▌2▐ in Figure 85) declared<br />
in the prototype of the containing macro definition.<br />
Thus, a sublist can be passed (see ▌3▐ in Figure 85) and referred to (see ▌4▐ in<br />
Figure 85) as a sublist in the macro definition called by the inner macro call. Also,<br />
any symbol (see ▌5▐ in Figure 85) that is passed carries its attribute values through<br />
the nesting levels.<br />
If inner macro calls at each level are specified with symbolic parameters as<br />
operand values, values can be passed from open code through several levels of<br />
macro nesting.<br />
COMPAT(SYSLIST) Assembler Option: If the COMPAT(SYSLIST) assembler<br />
option is specified, and a symbolic parameter is only a part of the value specified in<br />
an inner macro instruction operand, only the character string value given to the<br />
parameter by an outer call is passed through the nesting level. Inner sublist entries<br />
are, therefore, not available for reference in the inner macro.<br />
314 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>