SPNU118Z September 1995 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
Assemble Into Named Section
.sect "section name "
.sect " section name " [,{RO|RW}] [,{ALLOC|NOALLOC}]
The .sect directive defines a named section that can be used like the default .text and .data sections. The .sect directive sets section name to be the current section; the lines that follow are assembled into the section name section.
The section name identifies the section. The section name must be enclosed in double quotes. A section name can contain a subsection name in the form section name :subsection name. See Chapter 12 for more information about sections.
The sections can be marked read-only (RO) or read-write (RW). Also, the sections can be marked for allocation (ALLOC) or no allocation (NOALLOC). These attributes can be specified in any order, but only one attribute from each set can be selected. RO conflicts with RW, and ALLOC conflicts with NOALLOC. If conflicting attributes are specified the assembler generates an error, for example:
"t.asm", ERROR! at line 1:[E0000] Attribute RO cannot be combined with attr RW
.sect "illegal_sect",RO,RW
This example defines two special-purpose sections, Sym_Defs and Vars, and assembles code into them.
1 ******************************************************
2 ** Begin assembling into .text section. **
3 ******************************************************
4 00000000 .text
5 00000000 E3A00078 MOV R0, #78h
6 00000004 E2801078 ADD R1, R0, #78h
7 ******************************************************
8 ** Begin assembling into Sym_Defs section. **
9 ******************************************************
10 00000000 .sect "Sym_Defs"
11 00000000 3D4CCCCD .float 0.05 ; Assembled into Sym_Defs
12 00000004 000000AA X: .word 0AAh ; Assembled into Sym_Defs
13 00000008 E2833028 ADD R3, R3, #28h ; Assembled into Sym_Defs
14 ******************************************************
15 ** Begin assembling into Vars section. **
16 ******************************************************
17 00000000 .sect "Vars"
18 00000010 WORD_LEN .set 16
19 00000020 DWORD_LEN .set WORD_LEN * 2
20 00000008 BYTE_LEN .set WORD_LEN / 2
21 ******************************************************
22 ** Resume assembling into .text section. **
23 ******************************************************
24 00000008 .text
25 00000008 E2802042 ADD R2, R0, #42h ; Assembled into .text
26 0000000c 03 .byte 3, 4 ; Assembled into .text
0000000d 04
27 ******************************************************
28 ** Resume assembling into Vars section. **
29 ******************************************************
30 00000000 .sect "Vars"
31 00000000 000D0000 .field 13, WORD_LEN
32 00000000 000D0A00 .field 0Ah, BYTE_LEN
33 00000004 00000008 .field 10q, DWORD_LEN