A macro is a statement in a source program. It consists of a mnemonic operation code (macro name) specifying the particular function to be performed, which may be followed by values in the form of operands that supply information required for the execution of the macro, or give more details on the function to be performed (e.g. EXIT CONTINU=YES). The operands that may or must be specified are discussed in the “Description of themacros”.
Like every other source program statement, a macro is processed by the assembler at assembly time. Macro processing results in the source program macro being replaced by the macro expansion. A macro expansion consists of a sequence of instructions and assembly statements which together perform the function specified by the macro. When reference is made to statements generated by a macro, the macro expansion is meant.
The macro expansion is generated by the assembler via the macro definition. Every macro requires a macro definition. Macros can therefore be issued only if there is a corresponding macro definition. Macro definitions can be written by the user (see the “ASSEMBH” manual [2 (Related publications)]) or are supplied to the user as part of the operating system (such as those definitions whose macros are dealt with in the present manual). All available macro definitions are included in the macro library. A macro definition is the original specification that the assembler uses to generate the macro expansion.
The macro definition is modified by the operand specifications in the macro call, and current values are loaded.
The source program, in which all macros are replaced by their macro expansions, is then assembled into machine language. The macro expansions are included in the assembly listing, unless they are suppressed by the PRINT NOGEN assembly statement (see the “ASSEMBH” manual [2 (Related publications)]). The function requested by the macro is not performed until the program is executed.
A macro can be defined as the function which is implemented through the interaction of macro and macro definition.