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. The PC increments by 4 for each instruction word. In all architectures, odd values are not permitted.

Note: Instruction words in the PIC32A 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. The assembler will issue a strong warning if such usage is detected.