Executes a macro definition by assigning the macro name specified in the symbol field to a series of statements described between .macro directive and the .endm directive.
Symbol field |
Mnemonic field |
Operand field |
Comment field |
macro-name |
.macro : Macro body : |
[formal-parameter[, ... ]] |
[; comment] |
The .macro directive executes a macro definition by assigning the macro name specified in the symbol field to a series of statements (called a macro body) described between this directive and the .endm directive. |
Define a series of frequently used statements in the source program with a macro name. After its definition only describe the defined macro name, and the macro body corresponding to the macro name is expanded. |
For the macro name to be described in the symbol field, see the conventions of symbol description in "(2) Symbol". |
To call macro, describe the defined macro name in the mnemonic field. If a macro that is undefined at the point is called, an error occurs. |
For the formal parameter(s) to be described in the operand field, the same rules as the conventions of symbol description will apply. |
The number of formal parameters must be the same as the number of actual parameters. Otherwise, an error occurs. |
The number of macros that can be defined within a single source module is not specifically limited. In other words, macros may be defined as long as there is memory space available. |
The only actual parameters that can be specified in the macro call are label names, symbol names, numbers, registers, and instruction mnemonics. |
A line of a sentence can be designated in the macro-body. The part of a sentence, such as operand, cannot be allowed. |
An error will be output if a macro is defined in the macro body of a macro definition, but processing will continue (the content up to the corresponding ".endm" directive is ignored). Referencing a macro name will cause a definition error. |