22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Lookahead<br />

MACRO<br />

&NAME MOVE &TO,&FROM Statement 1<br />

&NAME ST 2,SAVEAREA Statement 2<br />

L<br />

2,&FROM<br />

ST<br />

2,&TO<br />

L<br />

2,SAVEAREA<br />

MEND<br />

------------------------------------------------------------------<br />

.SYM MOVE FIELDA,FIELDB Statement 3<br />

------------------------------------------------------------------<br />

+ ST 2,SAVEAREA Statement 4<br />

+ L 2,FIELDB<br />

+ ST 2,FIELDA<br />

+ L 2,SAVEAREA<br />

The symbolic parameter &NAME is used in the name field of the prototype statement<br />

(Statement 1) and the first model statement (Statement 2). In the macro instruction<br />

(Statement 3), a sequence symbol (.SYM) corresponds to the symbolic parameter<br />

&NAME. &NAME is not replaced by .SYM and, therefore, the generated statement<br />

(Statement 4) does not contain an entry in the name field.<br />

Lookahead<br />

Symbol attributes are established in either definition mode or lookahead mode.<br />

Definition mode occurs whenever a previously undefined symbol is encountered in<br />

the name field of a statement, or in the operand field of an EXTRN or WXTRN<br />

statement during open code processing. Symbols within a macro definition are<br />

defined when the macro is expanded.<br />

Lookahead mode is entered:<br />

When the assembler processes a conditional assembly instruction and<br />

encounters an attribute reference (other than D' and O') to an ordinary symbol<br />

that is not yet defined.<br />

When the assembler encounters a forward AGO or AIF branch in open code to<br />

a sequence symbol that is not yet defined.<br />

Lookahead is a sequential, statement-by-statement, forward scan over the source<br />

text.<br />

If the attribute reference is made in a macro, forward scan begins with the first<br />

source statement following the outermost macro instruction. During lookahead the<br />

assembler:<br />

Bypasses macro definition and generation<br />

Does not generate object text<br />

Does not perform open-code variable substitution<br />

Ignores AIF and AGO branch instructions<br />

Establishes interim data attributes for undefined symbols it encounters in<br />

operand fields of instructions. The data attributes are replaced when a symbol<br />

is subsequently encountered in definition mode.<br />

Lookahead mode ends when the desired symbol or sequence symbol is found, or<br />

when the END statement or end of file is reached. All statements read by<br />

340 <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!