Redefining conditional assembly instructions
You can use the OPSYN instruction to redefine conditional assembly instructions anywhere in your source module. A redefinition of a conditional assembly instruction affects only macro definitions occurring after the OPSYN instruction. The original definition of a conditional assembly instruction is always used during the processing of subsequent calls to a macro that was defined before the OPSYN instruction.
An OPSYN instruction that redefines the operation code of an assembler or machine instruction generated from a macro instruction is effective immediately, even if the definition of the macro was made prior to the OPSYN instruction. Consider the following example:
Name Operation Operand Comment
MACRO Macro header
MACRDEF … Macro prototype
AIF …
MVC …
⋮
MEND Macro trailer
⋮
AIF OPSYN AGO Assign AGO properties to AIF
MVC OPSYN MVI Assign MVI properties to MVC
⋮
MACRDEF … Macro call
(AIF interpreted as AIF instruct-
ion; generated AIFs not printed)
+ MVC … Interpreted as MVI instruction
⋮
Open code started at this point
AIF … Interpreted as AGO instruction
MVC … Interpreted as MVI instruction
In this example, AIF and MVC instructions are used in a macro definition. AIF is a conditional assembly instruction, and MVC is a machine instruction. OPSYN statements assign the properties of AGO to AIF and assign the properties of MVI to MVC. In subsequent calls of the macro MACRDEF, AIF is still defined, and used as an AIF operation, but the generated MVC is treated as an MVI operation. In open code following the macro call, the operations of both instructions are derived from their new definitions assigned by the OPSYN statements. If the macro is redefined (by another macro definition), the new definitions of AIF and MVC (that is, AGO and MVI) are used for further generations.
This description does not apply to nested macro definitions because the assembler does not edit inner macro definitions until it encounters them during the generation of its outer macro. An OPSYN statement placed before the outer macro instruction can affect conditional assembly statements in the inner macro definition.