.sect
Assign Character Strings to Substitution Symbols
4-78
Syntax
.sect
”
section name”
Description
The .sect directive defines a named section that can be used like the default
.text and .data sections. The .sect directive begins assembling source code
into the named section.
The
section name identifies a section that the assembler assembles code into.
The name can be up to 200 characters and must be enclosed in double quotes.
A section name can contain a subsection name in the form
section name:sub-
section name. For COFF1 formatted files, only the first 8 characters are signifi-
cant.
For more information about COFF sections, see Chapter 2,
Introduction to Common Object File Format.
Example
This example defines a special-purpose section named Vars and assembles
code into it.
1 **********************************************
2 ** Begin assembling into .text section. **
3 **********************************************
4 000000 .text
5 000000 E878 LD #78h, A ; Assembled into .text
6 000001 F000 ADD #36h, A ; Assembled into .text
000002 0036
7 **********************************************
8 ** Begin assembling into Vars section. **
9 **********************************************
10 000000 .sect ”Vars”
11 0010 WORD_LEN .set 16
12 0020 DWORD_LEN .set WORD_LEN * 2
13 0008 BYTE_LEN .set WORD_LEN / 2
14 **********************************************
15 ** Resume assembling into .text section. **
16 **********************************************
17 000003 .text
18 000003 F000 ADD #42h, A ; Assembled into .text
000004 0042
19 000005 0003 .byte 3, 4 ; Assembled into .text
000006 0004
20 **********************************************
21 ** Resume assembling into Vars section. **
22 **********************************************
23 000000 .sect ”Vars”
24 000000 000D .field 13, WORD_LEN
25 000001 0A00 .field 0Ah, BYTE_LEN
26 000002 0000 .field 10q, DWORD_LEN
000003 0008
27
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: ......