VMS Help  —  MACRO  /ALPHA  Supplied Library Macros, $OPDEF  Description
    You can use the $OPDEF macro to define your own opcodes.

    $OPDEF defines a macro using an unqualified version of the
    mnemonic name you specify. When this macro is invoked with the
    instruction qualifiers you specify when you define it with $OPDEF
    (if any), it expands to the instruction representation you have
    defined with $OPDEF. You can specify the qualifiers in any order
    as long as the combination of qualifiers you use is the same.

    Other uses of the mnemonic name remain valid provided you do not
    use the mnemonic name as a macro name in a .MACRO directive. For
    instance, you can use the same mnemonic name in the opcode field
    with different or no qualifiers. If the qualifiers (or absence
    thereof) do not match those specified in your $OPDEF instruction
    definition, the macro defined by $OPDEF processes as though you
    had not defined an instruction by that mnemonic name. To do
    so, it expands to a single statement. This expansion statement
    is identical to the mnemonic-name macro invocation statement,
    except it is processed in a context that prevents the mnemonic-
    name macro from expanding recursively. Instead, the statement
    is processed as a normal, MACRO-64 instruction statement. In
    this case, you may notice references to the mnemonic-name macro
    expansion in a MACAUXMSG diagnostic message if the instruction
    statement contains errors.

    For instance, if you define a STQ/P instruction using $OPDEF,
    you can still use the STQ instruction without the /P qualifier.
    If you do, and your STQ instruction statement contains an error,
    the assembler generates a MACAUXMSG message indicating that the
    error occurred during the expansion of macro STQ. Aside from
    the fact that the STQ instruction is processed in the context of
    the expansion of the STQ macro, $OPDEF's definition of the STQ/P
    instruction has no effect on your use of the STQ instruction.
Close Help