Using the #define Directive

Another way to define a macro is to use the #define directive. This will define a pre-processor style macro using a syntax that will be familiar to C programmers. Note that C pre-processor macros are complementary to the assembler's main MACRO...ENDM macro language.

Macro Definition Syntax: #define Directive shows the full syntax, and explains the syntax elements.

Listing 1. Macro Definition Syntax: #define Directive
#define 
name [ (
parms) ] 
assembly_statement [ ; ] [ \ ]
assembly_statement [ ; ] [ \ ]

assembly_statement

parms ::= 
parameter [ ,
parameter ]...
Note: If you specify parameters for a macro, you must enclose them in parentheses.
Table 1. Syntax Elements: #define Directive
Element Description
name Label that invokes the macro.
parameter Operand the assembler passes to the macro.
assembly_statement An assembly language statement. To extend the statement beyond the length of one physical line, type a backslash (\) at the end of a line, then continue the statement on the next line. To specify multiple statements on the same line, separate then with semicolon and backslash characters (;\).