4.5.4 The Special DOT Symbol
The special symbol ‘.
’ refers to the current address that is being assembled into. Thus, the expression:
melvin: .word . ; in a data section
defines melvin
to contain its own data address. Assigning a value to .
is treated the same as a .org
directive. Thus the expression:
. = .+2
is the same as saying:
.org .+2
The symbol ‘$’ is accepted as a synonym for ‘.
’.
When used in an executable section, ‘.
’
refers to a PC address. On dsPIC33C/E/F architectures, the PC increments by 2 for each
instruction word. On the dsPIC33A architecture, the PC increments by 4 for each instruction
word. In all architectures, odd values are not permitted.
Note: Instruction words in the dsPIC33A architecture are 4 bytes long,
and may contain 1 or 2 instructions. For this reason the use of a "dot expression" as a
branch target is risky and could result in a misaligned branch target address. Such usage,
while common in some legacy dsPIC33C/E/F code, should be avoided with the dsPIC33A
architecture. The assembler will issue a strong warning if such usage is detected.