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.23

Macro Directives

Directive

Overview

.MACRO

Defines a set of statements written between the .MACRO and .ENDM directives as a macro having the name specified in the symbol field

.LOCAL

Defines the specified symbol name as a local symbol that is valid only within the macro body where it is defined

.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 absolute-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.