CONSTANT - Declare Symbol Constant

MPASM Assembler

CONSTANT - Declare Symbol Constant

Syntax

constant <label>=<expr> [...,<label>=<expr>]

Description

Creates symbols for use in MPASM assembler expressions. Constants may not be reset after having once been initialized, and the expression must be fully resolvable at the time of the assignment. This is the principal difference between symbols declared as constant and those declared as variable, or created by the set directive. Otherwise, constants and variables may be used interchangeably in expressions.

Example

variable RecLength=64 ; Set Default

; RecLength

constant BufLength=512 ; Init BufLength

. ; RecLength may

. ; be reset later

. ; in RecLength=128

. ;

constant MaxMem=RecLength+BufLength ;CalcMaxMem

See Also

SET VARIABLE


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