#DEFINE - Define a Text Substitution Label

MPASM Assembler

#DEFINE - Define a Text Substitution Label

Syntax

#define <name> [<string>]

Description

This directive defines a text substitution string. Wherever <name> is encountered in the assembly code, <string> will be substituted.

Using the directive with no <string> causes a definition of <name> to be noted internally and may be tested for using the ifdef directive.

This directive emulates the ANSI 'C' standard for #define. Symbols defined with this method are not available for viewing using MPLAB IDE.

Example

#define length 20

#define control 0x19,7

#define position(X,Y,Z) (Y-(2 * Z +X))

:

:

test_label dw position(1, length, 512)

bsf control ; set bit 7 in f19

See Also

#UNDEFINE #INCLUDE IFDEF IFNDEF


Microchip Technology Inc.
Microchip's Web Site
Voice: (480) 792-7200
Fax: (480) 899-9210
Microchip's E-mail Address
PreviousNext