Download RASM77 V.5.10 User`s Manual

Transcript
C.2 Macro Instructions
.MACRO - .ENDM
Defines macro
Format:
▲macro-name▲.MACRO▲
▲ [argument 1,argument 2,..,argument n]
Description:
•
•
•
•
•
•
•
•
•
•
A macro definition starts with the line .MACRO and ends with the line .ENDM.
The string assigned to the .MACRO line becomes the name of the macro definition.
Macro definition can have arguments or no arguments. If arguments are used, the necessary
arguments must be passed during macro call.
When a macro call is made, the arguments are passed in the order of dummy arguments in
the macro definition.
Assembly language instructions, user macros, system macros, and pseudo instructions other
than .INCLUDE can be coded between .MACRO and .ENDM. Macro definitions can be
nested up to 20 levels.
Macro calls can be made anywhere in the program as long as it is after the macro definition.
An error will occur if a macro call is issued before it is defined. Macro calls can be nested up
to 20 levels.
The arguments specified in the macro call operand are replaced with the dummy arguments
in the macro definition from left to right. The number of arguments in the macro call and
macro definition need not be the same, but a warning is issued. If the number of arguments
on macro call is greater than the number of dummy arguments, the excess arguments are
ignored. If the number of arguments on macro call is less than the number of dummy
arguments, null character (string with length 0) is assigned to dummy arguments that have
no corresponding actual argument.
Any number of arguments can be specified on macro call regardless of the number of dummy
arguments in the macro definition. However, all arguments must fit in one line. Each argument must be delimited by a comma. To pass a comma or space as argument, enclose it in
double quotes. Commas inside parentheses are not treated as delimiters.
Macro expansion lines are indicated in the list file with a plus sign.
The same macro name can be used to define more than one macro. In this case, the
definition immediately prior to the call takes effect when a call is made.
1 - 97