Format of a macro call
The macro format comprises two areas.
The upper area contains the optional name field and the macro name.
The lower area contains the possible operands.
[name] macro name |
<operand1> ,<operand2> |
An entry in the name field is permitted; the name specified is the symbolic address of the first statement in the macro expansion. The user may use this address, for example, as a branch address or as a halt point when using the Interactive Debugging Aid.
The call formats in the present manual generally omit the name field except in cases where a specification in a name field is of special significance. An example would be a macro of type S in L form (see "S-type macros"): The symbolic address specified in the name field is required for linking the data area with the instruction part of the macro (E form). Further examples are the ARDS, CUPAB, DCSTA and TMODE macros, where the default name of the generated dummy section may be replaced by the specification in the name field. Such macro formats also comprise the name field.
The macro name identifies the required macro. The dollar sign '$' is not used as the first character in user macros, because it is reserved for privileged macros.
The operand field may contain any number of operands, separated by commas, but it may also remain empty. The type and number of operands that may or must be specified is defined in the format description of each macro.
When calling a macro in an Assembler program, the name field, macro name and first operand must be separated by at least one space. Multiple operands must be separated by commas.
Format errors that are detected by the Assembler when the macros are being processed are included in the Assembler listing as MNOTE messages (see section “Macro language” in the “ASSEMBH” manual [2 (Related publications)]).
Operand forms
Positional operands
Positional operands must be written in a specific order as they are interpreted by the Assembler on the basis of their position in the operand field.
Example: MACRO A,B,C
If the second operand (B) is deleted, the user must supply the second comma (immediately after the first comma) so as to maintain the proper position for the third operand (C):MACRO A,,C
However, if the last positional operands are omitted, the delimiting commas need not be written. For example, if the operands B and C are omitted in the present example, the macro could be written as follows: MACRO A
Keyword operands
The keyword associated with a given keyword operand uniquely identifies that operand to the Assembler. Therefore, these operands can be written in any order. An operand value which originates from a defined set of allowed values is assigned to an operand by an equals sign.
Keyword operands have the following format: <keyword>=<desired value>
Example: MACRO AREA=X,LENGTH=100
Mixed operands
An operand field may contain a combination of positional and keyword operands; however, all positional operands must precede all keyword operands.
Example: MAKRO A,B,C,AREA=X,LENGTH=100
The rules for positional operand and keyword operand omissions also apply to mixed operand fields. Thus, if the operands B, C and AREA are omitted, the above example appears as: MAKRO A,LENGTH=100
Operand sublists
A sublist consists of one or more positional operands, each separated by commas.
The entire list must be enclosed in parentheses, and is considered to be one operand in that it occupies a single position in the operand field or is associated with a single keyword. The contents of the sublist are processed similarly to positional operands.
Example: (A,B,C)
or (A)
In the second example, the sublist consists of only one operand. In this case, the enclosing parentheses must still be written, even though there is only one element in the sublist, as otherwise it will not be recognized as a sublist.
Metasyntax
In the macro format, specific characters (metacharacters) and conventions are used; an overview is given in the following description.
Appears as | Meaning | Example |
| Uppercase letters denote keywords or constants and |
|
UPPERCASE | Uppercase letters printed in boldface denote allowed |
GLOBAL=YES oder GLOBAL=Y |
| Lowercase letters denote data types of values, which can |
|
| Angle brackets denote variables whose allowed values |
|
| Braces enclose alternatives, i.e. one entry must be |
The user must enter
|
| The slash denotes a choice between alternatives; it has |
|
| Underlining denotes the default value of an operand, |
(no specification implies |
| Square brackets enclose options, i.e. the entries may be |
The user must enter, for |
Table 1: Macro syntax
Appears as | Meaning | Example |
| A list can be formed from the operand values following | FLAG=list-poss(3): *SLI/*SKIP/*DC The user must enter FLAG=*SKIP FLAG=(*SLI,*DC) |
| Ellipses denote repetition, i.e. the preceding syntactical |
The user must enter
etc. |
'BLANK' | This character denotes a blank (X'40') |
(without inverted |
| The equals sign links the operand name to the operand |
|
Table 1: Macro syntax
Data types of the operand values
Data type | Character set | Remarks |
| EBCDIC characters | must be enclosed in inverted |
| [+-] 0..2147483647 | is a decimal number |
| precedes specification of a variable. |
|
| Register 0..15 |
|
Suffixes to data types
Suffix | Meaning |
| for the |
for the | |
| in the |
The operand values can be entered directly as a character string or integer (see data types c-string
and integer
) or indirectly via a variable (see data type var:
). The following table contains the data types that are possible for variables.
Data types of variables
Data type | Description | Definition in |
| The variable is a character string of n characters. If no length is |
|
| The variable is an integer that occupies n bytes. |
|
| The variable is the enumeration of |
|
| The variable is an address or an address value. |
|