How to Interface C and Assembly Language with the TMS320 Floating Point C Compiler

Yves Gagniere, Dirk Langmesser · 1998

The Texas Instruments (TI™) TMS320 digital signal processor (DSP) floating-point ANSI C compiler generally uses a conventional mechanism for passing arguments and allocating local variables. Nevertheless, the programmer has several options to pass arguments to a function, to allocate automatic variables and to return a value from a called function. If the programmer uses only the C language, the C compiler manages a dedicated mechanism depending on the selected options at compile time. The mechanism regulates the data flow between the calling and the called function. These strict conventions are transparent to the user. If the user plans to interface assembly functions or routines to a C program, it is straightforward to follow the calling and returning conventions as well as the calling and called function's responsibilities regarding the saving and restoring of registers. This application report offers a simple approach using case studies to describe the main choices available to the programmer to interface C and assembly language. This report is based on revision 5 of the Texas Instruments TMS320 floating-point tools.

Read the paper · More papers on PaperTik