Creating a C-callable Assembly Function for the TMS320C28x DSP
C-callable assembly routines require an understanding of parameter-passing conventions and environments expected by the C compiler.
Interfacing C/C++ with assembly language functions is straightforward if you follow the calling conventions and the register conventions. C/C++ code can access variables and call functions defined in assembly language and assembly code can access C/C++ variables and call C/C++ functions.
These conventions are defined in section 7.4 of spru514c.pdf.
For the beginners, it is strongly advised to follow the compiler user guide and adhere to the conventions listed there in. It is not suggested to modify the generated assembly code as it may lead to discrepancies like breaking alignment restrictions, overwriting the wrong register etc.
However, the experienced users who are well aware of the compiler restrictions may modify generated assembly to get the function started. It is assumed that the users who opt for this method are well versed with the implications of changing the assembly code.
To know more about the procedure, please download the document here.