
Directives That Define Sections
6-5
Assembler Directives
6.2
Directives That Define Sections
These directives associate the various portions of an assembly language pro-
gram with the appropriate sections:
-
The .data directive identifies portions of code to place in data memory.
Data memory usually contains initialized data.
-
The .sect directive defines an initialized named section and associates
subsequent code or data with that section. A section defined with .sect can
contain code or data.
-
The .text directive identifies portions of code in the .text section. The .text
section usually contains executable code.
Example 6–1 shows how you can use sections directives to associate code
and data with the proper sections. This is an output listing; column 1 shows,
the SPC value and column 2 shows the memory contents, if affected by the
previous line, or a comment. (Each section has a section program counter
(SPC). The .start directive for a section determines that section’s initial SPC
value. When you resume assembling into a section, its SPC resumes counting
as if there had been no intervening code.
After the code in Example 6–1 is assembled, the sections contain:
.text
Bytes with the values 1, 2, 3, 4, 5, and 6
.data
Bytes with the values 9, 10, 11, and 12
mysect
Bytes with the values 21, 22, 23, 24
Note:
The .text and .data directives are short hand representations of .sect state-
ments for that section name.
.text
is equivalent to
.sect ”.text”
.data
is equivalent to
.sect ”.data”
Summary of Contents for TMS320C3 Series
Page 1: ...TMS320C3x DSP Starter Kit User s Guide...
Page 18: ...1 4...
Page 28: ...2 10...
Page 82: ...5 18...
Page 140: ...Communications Kernel Source Code A 12...
Page 145: ...Schematics B 5 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 146: ...Schematics B 6...
Page 147: ...Schematics B 7 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 148: ...Schematics B 8...
Page 149: ...Schematics B 9 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 150: ...Schematics B 10...
Page 154: ...B 14...
Page 160: ...C 6...
Page 166: ...Index 6...