Macro Calls

When a macro is invoked, the statement causing the action is termed a macro call. The syntax of a macro call consists of the following fields:

[ label] macro name [ arguments][ comment]

The argument field can have the form:

[ arg[ ,arg,...,arg]]

The macro call statement is made up of three fields besides the comment field: the label, if any, corresponds to the value of the location counter at the start of the macro expansion; the operation field which contains the macro name; and the operand field which contains substitutable arguments. Within the operand field, each calling argument of a macro call corresponds one-to-one with a dummy argument of the macro definition. For example, the N_R_MUL macro defined earlier could be invoked for expansion (called) by the statement

N_R_MUL CNT+1,VEC1,VEC2,OUT

where the operand field arguments, separated by commas and taken left to right, correspond to the dummy arguments NMUL through RESULT, respectively. These arguments are then substituted in their corresponding positions of the definition to produce a sequence of instructions.

Macro arguments consist of sequences of characters separated by commas. Although these can be specified as quoted strings, to simplify coding the Assembler does not require single quotes around macro argument strings. However, if an argument has an embedded comma or space, that argument must be surrounded by single quotes ('). An argument can be declared null when calling a macro. However, it must be declared explicitly null. Null arguments can be specified in four ways: by writing the delimiting commas in succession with no intervening spaces, by terminating the argument list with a comma and omitting the rest of the argument list, by declaring the argument as a null string, or by simply omitting some or all of the arguments. A null argument causes no character to be substituted in the generated statements that reference the argument. If more arguments are supplied in the macro call than appear in the macro definition, the Assembler outputs a warning.