HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

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

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>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!