There are a number of options in each of the above categories. Refer to the
TMS320C55x Optimizing C Compiler User's Guide [3] for detailed information on
how to use these options.
The options are preceded by a hyphen and are not case sensitive. All the single letter
options can be combined together, i.e., the options of -g, -k, and -s, are the same as
setting the compiler options as -gks. The two-letter operations can also be combined if
they have the same first letter. For example, setting -pl, -pk, and -pi three options are
the same as setting the options as -plki.
C language lacks specific DSP features, especially those of fixed-point data oper-
ations that are necessary for many DSP algorithms. To improve compiler efficiency for
real-time DSP applications, the C55x compiler provides a method to add in-line assem-
bly language routines directly into the C program. This allows the programmer to write
highly efficient assembly code for the time-critical sections of a program. Intrinsic is
another improvement for users to substitute DSP arithmetic operation with assembly
intrinsic operators. We will introduce more compiler features in Section 2.7 when we
present the mixing of C and assembly programs. In this chapter, we emphasize assembly
language programming.
2.3.2 Assembler
The assembler translates processor-specific assembly language source files (in ASCII
text) into binary COFF object files for specific DSP processors. Source files can contain
assembler directives, macro directives, and instructions. Assembler directives are used to
control various aspects of the assembly process such as the source file listing format,
data alignment, section content, etc. Binary object files contain separate blocks (called
sections) of code or data that can be loaded into memory space.
Assembler directives are used to control the assembly process and to enter data
into the program. Assembly directives can be used to initialize memory, define global
variables, set conditional assembly blocks, and reserve memory space for code and data.
Some of the most important C55x assembler directives are described below:
.BSS directive: The .bss directive reserves space in the uninitialized .bss section for
data variables. It is usually used to allocate data into RAM for run-time variables such
as I/O buffers. For example,
.bss xn_buffer, size_in_words
where the xn_buffer points to the first location of the reserved memory space, and the
size_in_words specifies the number of words to be reserved in the .bss section. If
we do not specify uninitialized data sections, the assembler will put all the uninitialized
data into the .bss section.
.DATA directive: The .data directive tells the assembler to begin assembling the
source code into the .data section, which usually contains data tables or pre-initialized
variables such as sinewave tables. The data sections are word addressable.
.SECT directive: The .sect directive defines a section and tells the assembler to
begin assembling source code or data into that section. It is often used to separate long
programs into logical partitions. It can separate the subroutines from the main pro-
gram, or separate constants that belong to different tasks. For example,
44
INTRODUCTION TO TMS320C55X DIGITAL SIGNAL PROCESSOR