Using Macro Parameters

An HLI assembler macro may have some parameters which are referenced in the macro code. The following listing defines the Clear1 macro that uses the var parameter.

Listing: Clear1 macro definition.


/* This macro initializes the specified variable to 0.*/
#define Clear1(var) {__asm CLR var;}
Listing: Invoking the Clear1 macro in the source code
Clear1(var1);
Listing: The preprocessor expands the Clear1 macro
{__asm CLR var1 ; };