SLAA534A June 2013 – June 2020
The MSP family uses a variety of assembly code addressing modes to implement data and code memory models. These modes are briefly listed here and described in detail in the "Addressing Modes" section of the MSP430x2xx Family User's Guide (SLAU144).
Addressing modes determine the type of relocation used. Relocations are discussed in Section 11.6.
Mode Name | Assembly Example | Relocation Type | Notes |
---|---|---|---|
Register mode | R5 | no relocation | |
Indexed mode | X(R5) | absolute relocation | |
Symbolic mode | ADDR | PC-relative relocation | This is actually Indexed mode, but with PC as the base register. |
Absolute mode(1) | &ADDR | absolute relocation | This is actually Indexed mode, but with SR as the base register. When used in this way, SR is treated as 0. |
Indirect register mode | @R5 | no relocation | |
Indirect autoincrement mode | @R5+ | no relocation | |
Immediate mode | #X | absolute relocation | This is actually Indirect autoincrement mode, but relative to the PC register. |