3.17 Attribute LABEL for first Macro Parameter

Asmc Macro Assembler

3.17 Attribute LABEL for first Macro Parameter

The LABEL attribute for the first macro parameter allows access to a label which is assigned to the macro. Syntax is:

<macro_name> MACRO <param_name>:LABEL [,<param_name>[, ...]]

The LABEL attribute is accepted for the first parameter only. A macro with such a parameter can be invoked in the following way:

<label> <macro_name> [<argument>, ...]

Example:

 
    foo macro lbl:LABEL, first, second
    lbl  db first
         dw second
    endm

    .data

    data1 foo 1,1000
    data2 foo 2,2000

Note that a code label ( that is, a label followed by a colon or double-colon ) is parsed BEFORE the macro is evaluated, hence such a label will have been defined already when the macro "runs".