Table 2.1 An example of C code and the C55x compiler generated assembly code
Code
Mnemonic assembly code
Algebraic assembly code
mov *SP(#0), AR2
AR2 *SP(#0)
add #_sineTable, AR2
AR2 AR2 #_sineTable
in_buffer[i] sineTable[i]; mov *SP(#0), AR3
AR3 *SP(#0)
add #_in_buffer, AR3
AR3 AR3 #_in_buffer
mov *AR2, *AR3
*AR3 *AR2
parameters and prompting the options. It is still beneficial for the user to understand
how to use these tools individually, and set parameters and options from the command
line correctly.
We can invoke the C compiler from a PC or workstation shell by entering the
following command:
c155 [-options][filenames][-z[link_options][object_files]]
The filenames can be one or more C program source files, assembly source files,
object files, or a combination of these files. If we do not supply an extension, the
compiler assumes the default extension as .c, .asm, or .obj. The -z option enables
the linker, while the -c option disables the linker. The link_options set up the way
the linker processes the object files at link time. The object_files are additional
objective files for the linker to add to the target file at link time. The compiler options
have the following categories:
1. The options that control the compiler shell, such as the -g option that generates
symbolic debug information for debugging code.
2. The options that control the parser, such as the -ps option that sets the strict ANSI
C mode for C.
3. The options that are C55x specific, such as the -ml option that sets the large
memory model.
4. The options that control the optimization, such as the -o0 option that sets the
register optimization.
5. The options that change the file naming conventions and specify the directories,
such as the -eo option that sets the default object file extension.
6. The options that control the assembler, such as the -al option that creates assem-
bly language listing files.
7. The options that control the linker, such as the -ar option that generates a re-
locatable output module.
SOFTWARE DEVELOPMENT TOOLS
43