This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
How to call an Assembly "macro" function in C language code??
example:
in xx.asm
add3 .macro P1, P2
MOV ACC,P1
ADD ACC,P2
.endm
in xx.c
extern void add3(int,int);
void main(void)
{
add3(10,2);
}
there is some tings wrong.
Thanks
I would like to recommend you review the information in this document.
http://focus.ti.com/general/docs/techdocsabstract.tsp?abstractName=spra806
As well as Section 7.4.3 in this document.
http://focus.ti.com/general/docs/techdocsabstract.tsp?abstractName=spra806
Ming said:As well as Section 7.4.3 in this document.
http://focus.ti.com/general/docs/techdocsabstract.tsp?abstractName=spra806
I believe the link intended here is for the TMS320C28x Optimizing C/C++ Compiler User's Guide (SPRU514).
In particular, Section 7.4 discusses interface C/C++ code with assembly. There are certain conventions which need to be maintained when interfacing C/C++ to assembly. Certain registers are used in a C function call to pass parameters, etc. However, I'm not sure if you can use inline assembly with macros. I certainly have not tried it.