T exas Instruments (TI) reserves the right to make changes to its products or to discontinue any
semiconductor product or service without notice, and advises its customers to obtain the latest
version of relevant information to verify , before placing orders, that the information being relied
on is current.
TI warrants performance of its semiconductor products and related software to the specifications
applicable at the time of sale in accordance with TI’s standard warranty . T esting and other quality
control techniques are utilized to the extent TI deems necessary to support this warranty.
Specific testing of all parameters of each device is not necessarily performed, except those
mandated by government requirements.
Certain applications using semiconductor products may involve potential risks of death,
personal injury , or severe property or environmental damage (“Critical Applications”).
TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR
WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES
OR SYSTEMS OR OTHER CRITICAL APPLICATIONS.
Inclusion of TI products in such applications is understood to be fully at the risk of the customer.
Use of TI products in such applications requires the written approval of an appropriate TI officer .
Questions concerning potential risk applications should be directed to TI through a local SC
sales office.
In order to minimize risks associated with the customer’s applications, adequate design and
operating safeguards should be provided by the customer to minimize inherent or procedural
hazards.
TI assumes no liability for applications assistance, customer product design, software
performance, or infringement of patents or services described herein. Nor does TI warrant or
represent that any license, either express or implied, is granted under any patent right, copyright,
mask work right, or other intellectual property right of TI covering or relating to any combination,
machine, or process in which such semiconductor products or services might be or are used.
The goal of this book is to help you learn how to use the Texas Instruments
assembly language tools specifically designed for the TMS320C54x DSPs.
This book is divided into four parts:
-
Introductory information gives you an overview of the assembly
language development tools and also discusses common object file
format (COFF), which helps you to use the TMS320C54x tools more
efficiently.
before using the assembler and linker.
-
Assembler description contains detailed information about using the
assembler. This section explains how to invoke the assembler and
discusses source statement format, valid constants and expressions,
assembler output, and assembler directives. It also describes macro
elements.
-
Additional assembly language tools describes in detail each of the
tools provided with the assembler to help you create assembly language
source files. For example, Chapter 7 explains how to invoke the linker, how
the linker operates, and how to use linker directives. Chapter 10 explains
how to use the hex conversion utility.
Read Chapter 2, Introduction to Common Object File Format,
iii
Notational Conventions
How to Use This Manual / Notational Conventions
-
Reference material provides supplementary information. This section
contains technical data about the internal format and structure of COFF
object files. It discusses symbolic debugging directives that the C compiler
uses. Finally, it includes hex conversion utility examples, assembler and
linker error messages, and a glossary.
Notational Conventions
This document uses the following conventions:
-
Program listings, program examples, and interactive displays appear in a
special typeface. Examples use a bold version of the special
typeface for emphasis; interactive displays use a bold version of the
special typeface to distinguish commands that you enter from items that
the system displays (such as prompts, command output, error messages,
etc.).
Here is a sample program listing:
2 00012fx .byte47
3 000232z.byte50
4 0003.text
-
In syntax descriptions, the instruction, command, or directive is in a bold
typeface font and parameters are in an
italic typeface
. Portions of a syntax
that are in bold should be entered as shown; portions of a syntax that are
in
italics
describe the type of information that should be entered. Here is
an example of command line syntax:
abs500
filename
abs500 is a command. The command invokes the absolute lister and has
one parameter, indicated by
filename
. When you invoke the absolute
lister, you supply the name of the file that the absolute lister uses as input.
-
Square brackets ( [ and ] ) identify an optional parameter. If you use an
optional parameter, you specify the information within the brackets; you
don’t enter the brackets themselves. This is an example of a command
that has an optional parameter:
hex500 [
–options] filename
The hex500 command has two parameters. The first parameter ,
is optional. Since
second parameter,
options
is plural, you may select several options. The
filename
, is required.
–options
,
iv
Notational Conventions
-
In assembler syntax statements, column 1 is reserved for the first
character of a label or symbol. If the label or symbol is optional, it is usually
not shown. If it is a required parameter, then it will be shown starting
against the left margin of the shaded box, as in the example below. No
instruction, command, directive, or parameter, other than a symbol or
label, should begin in column 1.
Note that .byte does not
begin in column 1.
symbol
The
The
words
blocking flag
.usect ”
section name”, size in words [, blocking flag]
[, alignment flag
symbol
is required for the .usect directive and must begin in column 1.
section name
must be enclosed in quotes and the section
must be separated from the
and
alignment flag
]
section name
by a comma. The
are optional and, if used, must be
separated by commas.
-
Some directives can have a varying number of parameters. For example,
the .byte directive can have up to 100 parameters. The syntax for this
directive is:
.byte
value
[,
... , value
1
]
n
This syntax shows that .byte must have at least one value parameter, but
you have the option of supplying additional value parameters, separated
by commas.
-
Following are other symbols and abbreviations used throughout this
document.
The following books describe the TMS320C54x devices and related support
tools. To obtain a copy of any of these TI documents, call the Texas
Instruments Literature Response Center at (800) 477–8924. When ordering,
please identify the book by its title and literature number.
TMS320C54x DSP Reference Set
ordered as a set with literature number SPRU210. T o order an individual
book, use the document-specific literature number:
is composed of four volumes that can be
TMS320C54x DSP Reference Set, Volume 1: CPU and Peripherals
(literature number SPRU131) describes the TMS320C54x 16-bit,
fixed-point, general-purpose digital signal processors. Covered
are its architecture, internal register structure, data and program
addressing, the instruction pipeline, DMA, and on-chip
peripherals. Also includes development support information, parts
lists, and design considerations for using the XDS510 emulator.
(literature number SPRU179) describes the TMS320C54x
digital signal processor algebraic instructions individually. Also
includes a summary of instruction set classes and cycles.
(literature number SPRU173) describes software and hardware
applications for the TMS320C54x digital signal processor. Also
includes development support information, parts lists, and design
considerations for using the XDS510 emulator.
TMS320 DSP Development Support Reference Guide
SPRU011) describes the TMS320 family of digital signal processors and
the tools that support these devices. Included are code-generation tools
(compilers, assemblers, linkers, etc.) and system integration and debug
tools (simulators, emulators, evaluation modules, etc.). Also covered are
available documentation, seminars, the university program, and factory
repair and exchange.
TMS320C54x Optimizing C Compiler User’s Guide
SPRU103) describes the ’C54x C compiler. This C compiler accepts
ANSI standard C source code and produces TMS320 assembly
language source code for the ’C54x generation of devices.
vi
(literature number
(literature number
Related Documentation From Texas Instruments / Trademarks
Trademarks
TMS320C54x C Source Debugger User’s Guide
(literature number
SPRU099) tells you how to invoke the ’C54x emulator, evaluation
module, and simulator versions of the C source debugger interface. This
book discusses various aspects of the debugger interface, including
window management, command entry, code execution, data
management, and breakpoints. It also includes a tutorial that introduces
basic debugger functionality.
TMS320 Third-Party Support Reference Guide
(literature number
SPRU052) alphabetically lists over 100 third parties that provide various
products that serve the family of TMS320 digital signal processors. A
myriad of products and applications are offered—software and hardware
development tools, speech recognition, image processing, noise
cancellation, modems, etc.
Digital Signal Processing Applications with the TMS320 Family, Volumes
1, 2, and 3
(literature numbers SPRA012, SPRA016, SPRA017)
Volumes 1 and 2 cover applications using the ’C10 and ’C20 families of
fixed-point processors. Volume 3 documents applications using both
fixed-point processors, as well as the ’C30 floating-point processor.
HP-UX is a trademark of Hewlett-Packard Company.
PC is a trademark of International Business Machines Corporation.
Solaris is a trademark of Sun Microsystems, Inc.
UNIX is a registered trademark of Unix System Laboratories, Inc.
XDS510 is a trademark of Texas Instruments Incorporated.
Read This First
vii
If You Need Assistance
If You Need Assistance. . .
-
World-Wide Web Sites
TI Onlinehttp://www.ti.com
Semiconductor Product Information Center (PIC)http://www.ti.com/sc/docs/pic/home.htm
DSP Solutionshttp://www.ti.com/dsps
320 Hotline On-line
-
North America, South America, Central America
Product Information Center (PIC)(972) 644-5580
TI Literature Response Center U.S.A.(800) 477-8924
Software Registration/Upgrades(214) 638-0333Fax: (214) 638-7742
U.S.A. Factory Repair/Hardware Upgrades(281) 274-2285
U.S. Technical Training Organization(972) 644-5580
DSP Hotline(281) 274-2320Fax: (281) 274-2324Email: dsph@ti.com
DSP Modem BBS(281) 274-2323
DSP Internet BBS via anonymous ftp to ftp://ftp.ti.com/pub/tms320bbs
-
Europe, Middle East, Africa
European Product Information Center (EPIC) Hotlines:
Literature Response Center+852 2 956 7288Fax: +852 2 956 2200
Hong Kong DSP Hotline+852 2 956 7268Fax: +852 2 956 1002
Korea DSP Hotline+82 2 551 2804Fax: +82 2 551 2828
Korea DSP Modem BBS+82 2 551 2914
Singapore DSP HotlineFax: +65 390 7179
Taiwan DSP Hotline+886 2 377 1450Fax: +886 2 377 2718
Taiwan DSP Modem BBS+886 2 376 2592
Taiwan DSP Internet BBS via anonymous ftp to ftp://dsp.ee.tit.edu.tw/pub/TI/
-
Japan
Product Information Center+0120-81-0026 (in Japan)Fax: +0120-81-0036 (in Japan)
DSP Hotline+03-3769-8735 or (INTL) 813-3769-8735Fax: +03-3457-7071 or (INTL) 813-3457-7071
DSP BBS via Nifty-ServeType “Go TIASP”
-
Documentation
When making suggestions or reporting errors in documentation, please include the following information that is on the title
page: the full title of the book, the publication date, and the literature number.
Discusses the basic COFF concept of sections and how they can help you use the assembler
and linker more efficiently . Common object file format, or COFF, is the object file format used
by the tools.
Explains how to invoke the hex utility to convert a COFF object file into one of several standard
hexadecimal formats suitable for loading into an EPROM programmer.
Explains how to invoke the mnemonic-to-algebraic translator utility to convert a source file
containing mnemonic instructions to a source file containing algebraic instructions.
C–17Map File Resulting From the Command File in Example C–16C-23. . . . . . . . . . . . . . . . . . . . .
C–18Hex Conversion Utility Output File Resulting From the Command File in C–16C-23. . . . . . .
xxii
Chapter 1
Introduction
The TMS320C54x DSPs are supported by the following assembly language
tools:
-
Assembler
-
Archiver
-
Linker
-
Absolute lister
-
Cross-reference utility
-
Hex conversion utility
-
Mnemonic-to-algebraic translator utility
This chapter shows how these tools fit into the general software tools development flow and gives a brief description of each tool. For convenience, it also
summarizes the C compiler and debugging tools; however, the compiler and
debugger are not shipped with the assembly language tools. For detailed
information on the compiler and debugger and for complete descriptions of the
TMS320C54x devices, refer to the books listed in
From Texas Instruments
on page vi.
Related Documentation
The assembly language tools create and use object files in common object file
format (COFF) to facilitate modular programming. Object files contain
separate blocks (called sections) of code and data that you can load into ’C54x
memory spaces. You can program the ’C54x more efficiently if you have a
basic understanding of COFF . Chapter 2,
Figure 1–1 illustrates the ’C54x software development flow. The shaded
portion of the figure highlights the most common path of software development; the other portions are optional.
Figure 1–1. TMS320C54x Software Development Flow
C
source
files
Macro
source
files
Archiver
C compiler
Assembler
source
Assembly
translation
assistant
Macro
library
Archiver
Library of
object
files
Hex conversion
utility
EPROM
programmer
Absolute lister
Assembler
COFF
object
files
Linker
Executable
COFF
file
Cross-reference
lister
Assembler
source
Library-build
utility
Runtime-
support
library
Debugging
tools
’C54x
1-2
1.2Tools Descriptions
The following list describes the tools that are shown in Figure 1–1:
-
The C compiler translates C source code into ’C54x assembly language
source code. The compiler package includes the library-build utility , with
which you can build your own runtime libraries. The C compiler is not
shipped with the assembly language tools package.
-
The assembler translates assembly language source files into machine
language COFF object files. Source files can contain instructions, assembler directives, and macro directives. Y ou can use assembler directives to
control various aspects of the assembly process, such as the source listing format, data alignment, and section content.
-
The linker combines relocatable COFF object files (created by the assembler) into a single executable COFF object module. As it creates the
executable module, it adjusts references to symbols and resolves external
references. It also accepts archiver library members and output modules
created by a previous linker run. Linker directives allow you to combine object file sections, bind sections or symbols to addresses or within memory
ranges, and define or redefine global symbols.
Tools Descriptions
-
The archiver collects a group of files into a single archive file. For exam-
ple, you can collect several macros into a macro library. The assembler
searches the library and uses the members that are called as macros by
the source file. You can also use the archiver to collect a group of object
files into an object library. The linker includes in the library the members
that resolve external references during the link.
-
The mnemonic-to-algebraic assembly translator utility converts an
assembly language source file containing mnemonic instructions to an
assembly language source file containing algebraic instructions.
-
The library-build utility builds your own customized, C, runtime-support
library . Standard runtime-support library functions are provided as source
code in rts.src and as object code in rts.lib.
-
The TMS320C54x DSP accepts COFF files as input, but most EPROM
programmers do not. The hex conversion utility converts a COFF object
file into TI-tagged, Intel, Motorola, or Tektronix object format. The
converted file can be downloaded to an EPROM programmer.
Introduction
1-3
Tools Descriptions
-
The absolute lister accepts linked object files as input and creates .abs
files as output. You assemble .abs files to produce a listing that contains
absolute rather than relative addresses. Without the absolute lister,
producing such a listing would be tedious and require many manual operations.
-
The cross-reference lister uses object files to produce a cross-reference
listing showing symbols, their definitions, and their references in the linked
source files.
The purpose of this development process is to produce a module that can be
executed in a ’C54x target system. Y ou can use one of several debugging tools
to refine and correct your code. Available products include:
-
An instruction-accurate software simulator
-
An extended development system (XDS510) emulator
-
An evaluation module (EVM)
For information about these debugging tools, see the
Debugger User’s Guide
.
TMS320C54x C Source
1-4
Chapter 2
Introduction to Common Object File Format
The assembler and linker create object files that can be executed by a
TMS320C54x device. The format for these object files is called common object
file format (COFF).
COFF makes modular programming easier, because it encourages you to
think in terms of blocks of code and data when you write an assembly language
program. These blocks are known as
linker provide directives that allow you to create and manipulate sections.
This chapter provides an overview of COFF sections. For additional
information, see Appendix A,
COFF structure.
Each COFF file type has a different header format. The data portions of the
COFF files are identical. For details about the COFF file structure, see
Appendix A,
The TMS320C54x assembler and C compiler create COFF2 files. The linker
can read and write all types of COFF files. By default, the linker creates COFF2
files. Use the –v linker option to specify a different format. The linker supports
COFF0 and COFF1 files for older versions of the assembler and C compiler
only.
COFF0
COFF1
COFF2
Common Object File Format
.
2.2Sections
The smallest unit of an object file is called a
section
. A section is a block of code
or data that will ultimately occupy contiguous space in the memory map. Each
section of an object file is separate and distinct. COFF object files always contain three default sections:
.text sectionusually contains executable code
.data sectionusually contains initialized data
.bss sectionusually reserves space for uninitialized variables
In addition, the assembler and linker allow you to create, name, and link
named
sections that are used like the .data, .text, and .bss sections.
There are two basic types of sections:
initialized sectionscontain data or code. The .text and .data sections
are initialized; named sections created with the
.sect assembler directive are also initialized.
uninitialized sectionsreserve space in the memory map for uninitialized
data. The .bss section is uninitialized; named
sections created with the .usect assembler directive are also uninitialized.
2-2
Several assembler directives allow you to associate various portions of code
and data with the appropriate sections. The assembler builds these sections
during the assembly process, creating an object file organized as shown in
Figure 2–1.
One of the linker’s functions is to relocate sections into the target memory map;
this function is called
allocation
. Because most systems contain several types
of memory, using sections can help you use target memory more efficiently.
All sections are independently relocatable; you can place any section into any
allocated block of target memory . For example, you can define a section that
contains an initialization routine and then allocate the routine into a portion of
the memory map that contains ROM.
Figure 2–1 shows the relationship between sections in an object file and a
hypothetical target memory.
Figure 2–1. Partitioning Memory Into Logical Blocks
Sections
Object File
.bss
.data
.text
Target Memory
RAM
EEPROM
ROM
Introduction to Common Object File Format
2-3
How the Assembler Handles Sections
2.3How the Assembler Handles Sections
The assembler identifies the portions of an assembly language program that
belong in a section. The assembler has five directives that support this
function:
-
.bss
-
.usect
-
.text
-
.data
-
.sect
The .bss and .usect directives create
and .sect directives create
You can create subsections of any section to give you tighter control of the
memory map. Subsections are created using the .sect and .usect directives.
Subsections are identified with the base section name and a subsection name
separated by a colon. See subsection 2.3.4,
information.
Note: Default Section Directive
If you don’t use any of the sections directives, the assembler assembles
everything into the .text section.
2.3.1Uninitialized Sections
Uninitialized sections reserve space in processor memory; they are usually
allocated into RAM. These sections have no actual contents in the object file;
they simply reserve memory. A program can use this space at runtime for
creating and storing variables.
Uninitialized data areas are built by using the .bss and .usect assembler
directives.
uninitialized sections
initialized sections
.
Subsections
; the .text, .data,
, page 2-8, for more
2-4
-
The .bss directive reserves space in the .bss section.
-
The .usect directive reserves space in a specific, uninitialized named
section.
Each time you invoke the .bss directive, the assembler reserves more space
in the appropriate section. Each time you invoke the .usect directive, the
assembler reserves more space in the specified named section.
Loading...
+ 439 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.