6.1.6 Identifiers
Assembly identifiers are user-defined symbols representing memory
locations or numbers. A symbol can contain any number of characters drawn from alphabetics,
numerics, as well as special characters: dollar, $
; question mark,
?
; and underscore, _
.
The first character of an identifier cannot be numeric nor the
$
character. The case of alphabetics is significant, e.g.,
is not the same symbol as
Fred
fred
. Some examples of identifiers are shown here:
An_identifier
an_identifier
an_identifier1
?$_12345
An identifier cannot have the same symbol (any case) as any of the
assembly code mnemonics (e.g. movlw
or return
) assembler
directives (e.g. SET
or LIST
), directive argument tokens
(e.g. hex
or push
), or operators (e.g.
mod
or nul
).
An identifier that begins with at least one underscore character can be accessed from C code. Care must be taken with such symbols that they do not interact with C code identifiers. Identifiers that do not begin with an underscore can only be accessed from the assembly domain. See the Equivalent Assembly Symbols section for the mapping between the C and assembly domains.