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.

MACRO and MEND Statements<br />

The assembler does not process the macro definition for INNER until OUTER is called<br />

with a value for &C other than a null string.<br />

Open Code: Open code is that part of a source module that lies outside of any<br />

source macro definition. At coding time, it is important to distinguish between<br />

source statements that lie in open code, and those that lie inside macro definitions.<br />

Format of a Macro Definition<br />

The general format of a macro definition is shown in Figure 63. The four parts are<br />

described in detail in the following sections.<br />

┌─────────────────────────────────────────────────┐<br />

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

│ │ MACRO Header statement │ │<br />

│ └───────────────────────────────────────────┘ │<br />

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

│ │ ANYNAME Prototype statement│ │<br />

│ └───────────────────────────────────────────┘ │<br />

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

│ │<br />

│ │<br />

│ │ Body of macro │ │<br />

│ │<br />

│ │<br />

│ └───────────────────────────────────────────┘ │<br />

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

│ │ MEND Trailer statement │ │<br />

│ └───────────────────────────────────────────┘ │<br />

└─────────────────────────────────────────────────┘<br />

Figure 63. Format of a Macro Definition<br />

Macro Definition Header and Trailer<br />

You must establish the boundaries of a macro definition by coding:<br />

A macro definition header statement as the first statement of the macro<br />

definition (a MACRO statement)<br />

A macro definition trailer statement as the last statement of the macro definition<br />

(a MEND statement)<br />

The instructions used to define the boundaries of a macro instruction are described<br />

in the following sections.<br />

MACRO Statement<br />

Use the MACRO statement to indicate the beginning of a macro definition. It must<br />

be the first non-comment statement in every macro definition. Library macro<br />

definitions may have ordinary or internal macro comments before the MACRO<br />

statement.<br />

►►──MACRO──────────────────────────────────────────────────────────►◄<br />

The MACRO statement must not have a name entry or an operand entry.<br />

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