Keyword arguments allow a macro call to specify the arguments
in any order. In this case, the macro call must specify the
same formal argument names that appear in the macro definition.
Keyword arguments are useful when a macro definition has more
formal arguments than necessary in the call.
In any one macro call, it is good practice to specify the
arguments as either all positional arguments or all keyword
arguments. For example, the following macro definition specifies
three arguments:
.MACRO STORE ARG1,ARG2,ARG3
.LONG ARG1
.WORD ARG3
.BYTE ARG2
.ENDM STORE
The following macro call specifies keyword arguments:
STORE ARG3=27+5/4,ARG2=5,ARG1=SYMBL
.LONG SYMBL
.WORD 27+5/4
.BYTE 5
Because the keywords are specified in the macro call, the
arguments in the macro call need not be given in the order they
were listed in the macro definition.
Positional and keyword arguments may be mixed. Usually,
positional arguments are placed before keyword arguments. For
example:
.MACRO STORE ARG1,ARG2,ARG3=27+5/4
.LONG ARG1
.BYTE ARG2
.WORD 27+5/4
.ENDM STORE
NOTE
Keyword arguments are not counted when positional arguments
are parsed. This means that when positional and keyword
arguments are used in the same macro, one argument can be
specified twice. The last value specified for the argument
is used.