SPRAC71B February 2019 – October 2023
C28x devices use a variety of assembly code addressing modes. These modes are briefly listed here and described in detail in the "C28x Addressing Modes" chapter of the TMS320C28x DSP CPU and Instruction Set Reference Guide (SPRU430).
The C28x EABI calling convention requires that the address mode bit (AMODE) of the Status Register (ST1) be set to 0, which is the default. Setting AMODE=0 restricts the set of addressing modes allowed, but allows SP-relative addressing.
Note that assembly code may set AMODE=1, so the linker must be prepared to handle 7-bit direct addressing.
.
Mode Name | Assembly Example | Relocation Type | Notes |
---|---|---|---|
Direct addressing | MOV AL, @var | DP-relative relocation | |
Stack addressing | MOV AL,*-SP[4] | no relocation | |
Indirect addressing | MOV AL,*XAR3 | no relocation | |
Register addressing | MOV ACC, @T | no relocation | memory-mapped register move |
Data immediate addressing | MOV AL, *(0:var) | absolute relocation | |
Program immediate addressing | MAC P, loc16, 0:pma | absolute relocation | loc16 is an entirely distinct memory operand |
I/O immediate addressing | OUT *(addr), loc16 | absolute relocation | loc16 is an entirely distinct memory operand |