SPRAB89A September 2011 – March 2014
This is a position-independent way of addressing far data; that is, data in segments other than the near DP segment. The 32-bit DP-relative offset is loaded into a register using 2 MVK instructions, which is then added to the DP using indexed addressing. The offset must be appropriately scaled for the size of the access. The TI toolchain uses special assembly language operators to indicate the scale factor.
MVKL $DPR_word(sym),tmp ;reloc R_C6000_SBR_L16_W
MVKH $DPR_word(sym),tmp ;reloc R_C6000_SBR_H16_W
LDW *+DP(tmp),dest
MVKL $DPR_hword(sym),tmp ;reloc R_C6000_SBR_L16_H
MVKH $DPR_hword(sym),tmp ;reloc R_C6000_SBR_H16_H
LDH *+DP(tmp),dest
MVKL $DPR_byte(sym),tmp ;reloc R_C6000_SBR_L16_B
MVKH $DPR_byte(sym),tmp ;reloc R_C6000_SBR_H16_B
LDB *+DP(tmp),dest