The macro instruction prototype statement (from here on called
the "prototype statement") specifies the mnemonic operation code
and the format of all macro instructions that you use to call the
macro definition.
The prototype statement must be the second non-comment statement
in every macro definition. Both ordinary comment statements and internal
comment statements are allowed between the macro definition header
and the macro prototype. Such comment statements are listed only
with the macro definition.
>>-+------------+--operation_field------------------------------>
'-name_entry-'
>--+------------------------+----------------------------------><
| .-,------------------. |
| V | |
'---symbolic_parameter-+-'
- name_entry
- Is a variable symbol.
You can write this parameter, like the symbolic
parameter, as the name entry of a macro prototype statement. You can then assign
a value to this parameter from the name entry in the calling macro
instruction.
If this parameter also appears in the body of
a macro, it is given the value assigned to the parameter in the name
field of the corresponding macro instruction.
- operation_field
- Is an ordinary symbol.
The symbol in the operation field
of the prototype statement establishes the name by which a macro definition
must be called. This name becomes the operation code required in any
macro instruction that calls the macro.
Any operation code
can be specified in the prototype operation field. If the entry is
the same as an assembler or a machine operation code, the new definition
overrides the previous use of the symbol. The same is true if the
specified operation code has been defined earlier in the program as
a macro, in the operation code of a library macro, or defined in an
OPSYN instruction as equivalent to another operation code.
Macros
that are defined inline can use any ordinary symbol, up to 63 characters
in length, for the operation field. However, operating system rules
might prevent some of these macros from being stored as member names
in a library.
The assembler requires that the library member
name and macro name are the same; otherwise error diagnostic message ASMA126S Library macro name incorrect is issued.
- symbolic_parameter
- The symbolic parameters are used in the macro definition to
represent the operands of the corresponding macro instruction. A
description of symbolic parameters appears under Symbolic parameters.
The operand field in a prototype statement lets you specify positional
or keyword parameters. These parameters represent the values you
can pass from the calling macro instruction to the statements within
the body of a macro definition.
The operand field of the macro
prototype statement must contain 0 to 32000 symbolic parameters separated
by commas. They can be positional parameters or keyword parameters,
or both.
If no parameters are specified in the operand field
and if the absence of the operand entry is indicated by a comma preceded
and followed by one or more spaces, remarks are allowed.
Here is an example of a prototype statement:
&NAME MOVE &TO,&FROM