Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
Macro Assembler
 2012 Microchip Technology Inc.
DS52053B-page 251
6.4.6
Identifiers
Assembly identifiers are user-defined symbols representing memory locations or num-
bers. A symbol may contain any number of characters drawn from the alphabetics, 
numerics and the special characters dollar, $, question mark, ? and underscore, _.
The first character of an identifier may not be numeric. The case of alphabetics is sig-
nificant, e.g., Fred is not the same symbol as fred. Some examples of identifiers are 
shown here:
An_identifier
an_identifier
an_identifier1
$
?$_12345
An identifier cannot be one of the assembler directives, keywords, or psect flags.
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 Section 5.12.3.1 “Equivalent Assembly Symbols” fo
the mapping between the C and assembly domains.
6.4.6.1
SIGNIFICANCE OF IDENTIFIERS
Users of other assemblers that attempt to implement forms of data typing for identifiers 
should note that this assembler attaches no significance to any symbol, and places no 
restrictions or expectations on the usage of a symbol.
The names of psects (program sections) and ordinary symbols occupy separate, 
overlapping name spaces, but other than this, the assembler does not care whether a 
symbol is used to represent bytes, words or sports cars. No special syntax is needed 
or provided to define the addresses of bits or any other data type, nor will the assembler 
issue any warnings if a symbol is used in more than one context. The instruction and 
addressing mode syntax provide all the information necessary for the assembler to 
generate correct code.
6.4.6.2
ASSEMBLER-GENERATED IDENTIFIERS
Where a LOCAL directive is used in a macro block, the assembler will generate a 
unique symbol to replace each specified identifier in each expansion of that macro. 
These unique symbols will have the form ??nnnn where nnnn is a 4 digit number. The 
user should avoid defining symbols with the same form.
6.4.6.3
LOCATION COUNTER
The current location within the active program section is accessible via the symbol $. 
This symbol expands to the address of the currently executing instruction (which is dif-
ferent to the address contained in the program counter (PC) register when executing 
this instruction). Thus:
GOTO $   ;endless loop
will represent code that will jump to itself and form an endless loop. By using this 
symbol and an offset, a relative jump destination can be specified.