#EXEC: Execute macro

Use this macro to generate an EX instruction. See the z/Architecture Principles of Operation for more information about the EX instruction.

Note: You can also use the #EXEC macro as a conditional expression; see Conditional expression format for more information about the syntax of a conditional expression.

Last updated

  • Changed for PUT11.
  • Changed for PUT07.
  • Changed for PUT05.
  • Changed for PUT00.

Format

Read syntax diagramSkip visual syntax diagram#EXEC reg, (copcode,operand,msk,mnemonic,operand)(opcode,operand,msk,operand,mnemonic)
reg
The register to use as the first operand in the EX instruction.
copcode
An operation code starting with C; for example, CLC, CR, and so on.
opcode
An operation code that sets a condition code but does not start with C; for example, TM, OC, and so on.
operand
An operand for the instruction, which can be anything that the assembler language allows for an assembler instruction operand. For more information about assembler instructions and valid operands, see the z/Architecture Principles of Operation. Some of the types of operands are as follows:
  • A register, in the form Rn, where n is the register number; for example, R1.
  • A label refers to a defined area of storage (DS), a defined constant (DC), or an equated value. Generally, the size and type of label is implied from the type of instruction. However, you can force the size and type by prefixing the label as follows:
    A/label
    Specifies a 4-byte address contained at location label.
    F/label
    Specifies a fullword starting at location label.
    H/label
    Specifies a halfword starting at location label.
    X/label
    Specifies a byte starting at location label.
    I/label
    Specifies a 1-byte equated value.
    P/label
    Specifies packed data at location label.
  • A numeric value, which must be an integer.
  • A literal, for example:
    • A fullword (=F"1000")
    • A halfword (=H"10")
    • Characters (=C"HELLO")

    For more information about literals, see the z/Architecture Principles of Operation.

  • An equate.
  • An immediate value, which is a string that represents 1 byte and can be one of the following:
    • Character (C"A")
    • Hexadecimal (X'40')
    • Binary (B'10101010')
    • Length (L'EBW000)
  • An arithmetic expression, which is an expression that resolves into an arithmetic value. For example:
    • 10 + 3
    • FLD + 10
msk
is the M3 or R3 operand of an RS instruction. See the z/Architecture Principles of Operation for more information about the RS instruction.
Note: You must specify the msk with an RS instruction. Do not specify the msk for a non-RS instruction.
mnemonic
is one of the condition-code mnemonics shown in Table 1.
Note: You must specify the mnemonic when you use the #EXEC macro as a conditional expression. Do not specify the mnemonic when using the #EXEC macro alone.

Entry requirements

None.

Return conditions

Control is returned to the next sequential instruction.

Programming considerations

  • If AMODE=64 is coded on the BEGIN macro, all 8 bytes of a register are used.
  • For information about macro register conventions, see Assembler program register conventions.
  • All labels used in the SPM conditional expression can be no more than 32 characters long. Any additional characters are truncated.
  • The register specified for reg is used as the first operand in the EX instruction. The rest of the expression is the subject instruction of the EX instruction and the branching condition. See the z/Architecture Principles of Operation for more information about the EX instruction.
  • On return from any macro specified as part of the #EXEC macro group, the contents of R0–R9 are unchanged, unless those registers are specified on the macro call. Any registers specified may be changed, depending on its usage, as part of the #EXEC macro group processing.

Examples

  • In the following example, the #EXEC macro is used as a conditional expression for a #IF statement.
             #IF   #EXEC,R2,TM,FLAGS,X'00',ON
              :
    *   Code to process
              :
             #EIF
    
  • In the following example, the #EXEC macro is used to process a Move Character (MVC) instruction.
             #EXEC R5,MVC,EBW008(0),EBW008
              :
    
  • In the following example, the #EXEC macro is used to process a Compare Logical Character under Mask (CLM) instruction.
             #EXEC R5,CLM,R6,0,0(R14)
              :