To avoid confusion, it should be noted that the term “macro type” does not refer to the terms “action macro” and “definition macro”. These two terms refer to the function of a macro:
An action macro is a macro from which the execution of certain actions is expected; a typical example is the PRNT macro, which controls a print operation.
A definition macro is a macro from which definitions (such as addressing aids, DSECTS), rather than actions, are expected. The CUPAB macro is an example for the generation of symbolic names for addressing operand tables.
Macros are divided into types according to the way in which they pass operands, namely the R type (where the operands are passed in registers), the S type (where they are passed in memory), and the so-called O type, which do not have a specific type assignment.Macros of type S can be either action macros (MF=E) or definition macros (MF=D).
R type macros
Operation | Operands |
macro |
A macro is an R type macro if all necessary operand values can be loaded into the two registers (R0 and R1) used for this purpose. An R type macro therefore generates no parameter area.
S type macros
For an S type macro, the operand values specified in the macro are passed to the function module in the form of a data area which is part of the macro expansion. It contains the data and memory definitions (DC and DS statements) necessary for passing the operand values.
Name | Operation | Operands |
[opaddr] | macro |
The S type supports specification of the MF operand. In accordance with the different functions of the various macros, the MF operands can be represented in different ways:
Standard form (MF=S):
MF=S is the default value. The command section is generated first, followed by the data area, taking into account the operand values specified in the macro. The data area does not contain any field names or any explanatory equates. The standard header is initialized.
L form (MF=L):
Only the data area is generated, taking into account the operand values specified in the macro. The data area does not contain any field names or any explanatory equates. The standard header is initialized. The macro is usually issued in the definition section of the program. For shared-code programming, this call must not be in the invariant part of the program if it contains variable data. In the invariant part of the program the data area is initialized with constant values, copied to a local data area before the E form is called, and modified in this local area if necessary. Modification can be handled, for example, with the M form if it is available for the relevant interface.
C form (MF=C / MF=(C,p)):
Only the data area is generated; any operand values specified in the macro are not evaluated. Each field has a field name and, if necessary, explanatory equates. The first characters of each field name can be specified (p = a prefix which replaces the first characters). The data area is terminated with a length equate. The standard header must generally be initialized by the user.
D form (MF=D / MF=(D,p)):
A DSECT is generated. Each field has a field name and, if necessary, explanatory equates. The first characters of each field name can be specified (p = a prefix which replaces the first characters). The DSECT describes the structure of a memory area without taking up any memory space itself. It is terminated with a length equate. There is no switch to the initial location counter. The symbolic name specified for the DSECT is entered in an ESD record. The location counter is set to 0.
E form:
Only the commands necessary for calling the function module are generated. The command section usually ends with an SVC. In the macro, the address of the data area must be specified with the operand values; the following forms are commonly used:
MF=(E,addr)
MF=(E,(r))
MF=E,PARAM=addraddr = address of the data area
r = register containing the address of the data area
addr =No further operands are evaluated in the E form
M form (MF=M)
Commands (such as MVCs) are generated. During program execution, these overwrite fields in a data area already initialized with MF=M or, in the case of shared-code programming, in a local copy of the data area initialized with MF=L with the operand values specified in the macro. This therefore makes it easy to dynamically modify the operand values with which a macro is called, in order to adapt it to the requirements of the program.
Since the commands generated for this purpose use addresses and equates in the C form or D form, care must be taken, when using the M form, that these names are available for addressing of the operand list to be modified. In particular, care must be taken that the operands PREFIX and MACID, if specified in a macro with MF=M, receive the same values as those specified in the related macro with MF=C or MF=D.
A detailed description of the MF forms can be found in the “Executive Macros” manual [8 (Related publications)].
O type macros
Some macros cannot be classified as R type or S type: they are macros without a type assignment.
O type macros are, for example, macros for which one register (often only R1) is specified in the operand field. This register contains the start address of an operand list.
The operand list is defined in the data section of the program (with DC statements) and contains the actual operand values.