5.2.7 Macro directives

When describing a source it is inefficient to have to describe for each series of high usage frequency instruction groups. This is also the source of increased errors.

Via macro directives, using macro functions it becomes unnecessary to describe many times to the same kind of instruction group series, and coding efficiency can be improved.

Macro basic functions are in substitution of a series of statements.

The following macro directives are available.

Table 5.14

Macro Directives

Directive

Overview

.macro

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.

.local

The specified string is declared as a local symbol that will be replaced as a specific identifier.

.rept

Tells the assembler to repeatedly expand a series of statements described between .rept directive and the .endm directive the number of times equivalent to the value of the expression specified in the operand field.

.irp

Tells the assembler to repeatedly expand a series of statements described between .irp directive and the .endm directive the number of times equivalent to the number of actual parameters while replacing the formal parameter with the actual parameters (from the left, the order) specified in the operand field.

.exitm

This directive skips the repetitive assembly of the .irp and .rept directives enclosing this directive at the innermost position.

.exitma

This directive skips the repetitive assembly of the irp and .rept directives enclosing this directive at the outermost position.

.endm

Instructs the assembler to terminate the execution of a series of statements defined as the functions of the macro.