Digital Signal Processing Reference
In-Depth Information
memory space, as an instruction does. It does not produce executable code.
Addresses of different sections can be specified with assembler directives. For
example, the assembler directive .sect “my_buffer” defines a section of code
or data named my _ buffer . The directives .text and .data indicate a section for
text and data, respectively. Other assembler directives, such as .ref and .def , are
used for undefined and defined symbols, respectively. The assembler creates several
sections indicated by directives such as .text for code and .bss for global and
static variables.
Other commonly used assembler directives are:
1. .short : to initialize a 16-bit integer.
2. .int : to initialize a 32-bit integer (also .word or .long ). The compiler treats
a long data value as 40 bits, whereas the C6x assembler treats it as 32 bits.
3. .float : to initialize a 32-bit IEEE single-precision constant.
4. .double : to initialize a 64-bit IEEE double-precision constant.
Initialized values are specified by using the assembler directives .byte , .short ,
or .int . Uninitialized variables are specified using the directive .usect , which
creates an uninitialized section (like the .bss section), whereas the directive .sect
creates an initialized section. For example, .usect “variable”, 128 designates
an uninitialized section named variable with a section size of 128 in bytes.
3.10 LINEAR ASSEMBLY
An alternative to C, or assembly code, is linear assembly. An assembler optimizer
(in lieu of a C compiler) is used in conjunction with a linear assembly-coded source
program (with extension .sa ) to create an assembly source program (with exten-
sion .asm ) in much the same way that a C compiler optimizer is used in conjunc-
tion with a C-coded source program. The resulting assembly-coded program
produced by the assembler optimizer is typically more efficient than one resulting
from the C compiler optimizer. The assembly-coded program resulting from either
a C-coded source program or a linear-assembly source program must be assembled
to produce an object code.
Linear assembly code programming provides a compromise between coding
effort and coding efficiency. The assembler optimizer assigns the functional unit and
register to use (optional to be specified by the user), finds instructions that can
execute in parallel, and performs software pipelining for optimization (discussed in
Chapter 8). Two programming examples at the end of this chapter illustrate a C
program calling a linear assembly function. Parallel instructions are not valid in a
linear assembly program. Specifying the functional unit is optional in a linear assem-
bly program as well as in an assembly program.
In recent years, the C compiler optimizer has become more and more efficient.
Although C code is less efficient (speed performance) than assembly code, it typi-
Search WWH ::




Custom Search