![background image](http://html.mh-extra.com/html/texas-instruments/tms320c54x/tms320c54x_user-manual_1097113171.webp)
.text
Assemble Into .text Sections
4-88
Syntax
.text
Description
The .text directive tells the assembler to begin assembling into the .text sec-
tion, which usually contains executable code. The section program counter is
set to 0 if nothing has yet been assembled into the .text section. If code has
already been assembled into the .text section, the section program counter is
restored to its previous value in the section.
.text is the default section. Therefore, at the beginning of an assembly, the as-
sembler assembles code into the .text section unless you specify a different
sections directive (.data or .sect).
For more information about COFF sections, see Chapter 2,
Introduction to Common Object File Format.
Example
This example assembles code into the .text and .data sections. The .data sec-
tion contains integer constants, and the .text section contains executable
code.
1 *****************************************
2 ** Begin assembling into .data section.**
3 *****************************************
4 000000 .data
5 000000 000a .byte 0Ah, 0Bh
000001 000b
6
7 ******************************************
8 ** Begin assembling into .text section. **
9 ******************************************
10 000000 .text
11 000000 0041 START: .string ”A”,”B”,”C”
000001 0042
000002 0043
12 000003 0058 END: .string ”X”,”Y”,”Z”
000004 0059
000005 005a
13
14 000006 0000’ ADD START, A
15 000007 0003’ ADD END, A
16 *******************************************
17 ** Resume assembling into .data section.**
18 *******************************************
19 000002 .data
20 000002 000c .byte 0Ch, 0Dh
000003 000d
21 *******************************************
22 ** Resume assembling into .text section.**
23 *******************************************
24 000008 .text
25 000008 0051 .string ”Quit”
000009 0075
00000a 0069
00000b 0074
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: ......