Create a Relocatable Label
.label
4-59
Assembler Directives
Syntax
.label
symbol
Description
The .label directive defines a special
symbol that refers to the loadtime ad-
dress rather than the runtime address within the current section. Most sections
created by the assembler have relocatable addresses. The assembler as-
sembles each section as if it started at 0, and the linker relocates it to the ad-
dress at which it loads and runs.
For some applications, it is desirable to have a section load at one address and
run at a
different address. For example, you may wish to load a block of perfor-
mance-critical code into slower off-chip memory to save space, and then move
the code to high-speed on-chip memory to run it.
Such a section is assigned two addresses at link time: a load address and a
run address. All labels defined in the section are relocated to refer to the run-
time address so that references to the section (such as branches) are correct
when the code runs.
The .label directive creates a special
label that refers to the loadtime address.
This function is useful primarily to designate where the section was loaded for
purposes of the code that relocates the section.
Example
This example shows the use of a loadtime address label.
.sect ”.EXAMP”
.label EXAMP_LOAD ; load address of section.
START: ; run address of section.
<code>
FINISH: ; run address of section end.
.label EXAMP_END ; load address of section end.
For more information about assigning runtime and loadtime addresses in the
linker, see Section 7.9,
Specifying a Section’s Runtime Address, on page 7-41.
Summary of Contents for TMS320C54x
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 276: ......
Page 277: ......
Page 278: ......
Page 279: ......
Page 280: ......
Page 281: ......
Page 282: ......
Page 283: ......
Page 284: ......
Page 285: ......
Page 286: ......
Page 287: ......
Page 288: ......
Page 289: ......
Page 290: ......
Page 291: ......
Page 292: ......
Page 293: ......
Page 294: ......
Page 295: ......
Page 296: ......
Page 297: ......
Page 298: ......
Page 299: ......
Page 300: ......
Page 301: ......
Page 302: ......