22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Prototype Statement<br />

MEND Statement<br />

Use the MEND statement to indicate the end of a macro definition. It also provides<br />

an exit when it is processed during macro expansion. It can appear only once<br />

within a macro definition and must be the last statement in every macro definition.<br />

►►──┬─────────────────┬──MEND──────────────────────────────────────►◄<br />

└─sequence_symbol─┘<br />

sequence_symbol<br />

is a sequence symbol.<br />

See “MEXIT Instruction” on page 260 for details on exiting from a macro before the<br />

MEND statement.<br />

Macro Instruction Prototype<br />

The macro instruction prototype statement (hereafter called the prototype<br />

statement) specifies the mnemonic operation code and the format of all macro<br />

instructions that you use to call the macro definition.<br />

The prototype statement must be the second non-comment statement in every<br />

macro definition. Both ordinary comment statements and internal comment<br />

statements are allowed between the macro definition header and the macro<br />

prototype. Such comment statements are listed only with the macro definition.<br />

►►──┬────────────┬──operation_field──┬────────────────────────┬────►◄<br />

└─name_field─┘<br />

│ ┌─,──────────────────┐<br />

│<br />

└── ▼ ─symbolic_parameter─┴─┘<br />

name_field<br />

is a variable symbol.<br />

You can write a name field parameter, similar to the symbolic parameter, as the<br />

name entry of a macro prototype statement. You can then assign a value to<br />

this parameter from the name entry in the calling macro instruction.<br />

If this parameter also appears in the body of a macro, it is given the value<br />

assigned to the parameter in the name field of the corresponding macro<br />

instruction.<br />

operation_field<br />

is an ordinary symbol.<br />

The symbol in the operation field of the prototype statement establishes the<br />

name by which a macro definition must be called. This name becomes the<br />

operation code required in any macro instruction that calls the macro.<br />

Any operation code can be specified in the prototype operation field. If the<br />

entry is the same as an assembler or a machine operation code, the new<br />

definition overrides the previous use of the symbol. The same is true if the<br />

specified operation code has been defined earlier in the program as a macro,<br />

or is the operation code of a library macro.<br />

Chapter 7. How to Specify Macro Definitions 245

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

Saved successfully!

Ooh no, something went wrong!