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.
Hi all,
I would like to inline a c-function into an assembler file. I did not find any advices in the manuals. My own trials failed cause I don't know how to call the function from the assembly (lcr is not suitable obviously) - I think I should do it similar to a macro call, but how must the c-function be defined then??
Any proposals are very welcome
Best regards,
Andreas
Andreas,
There is a section in the C/C++ Compiler Users Guide that talks about Interfacing C with Assembly Language. Have you taken a look at this section? You didn't mention the device you are using, but if it c28x, please refer to section 7.4 of the C28x Optimizing C/C++ Compiler Users Guide.
This application note might also be helpful: http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spra806
Hi Aarti,
Yes I use a C28x device,
and yes I did read the documents you mentioned - but they mainly cover the topic how to access asm functions from c environment. what I'd like to do is the vice versa, accessing a c function from assembly environment and inline this function in the assembly code. So I am still hanging in the nowhere... right now I think what I would like to do is even impossible, though still hoping I am wrong.
Andreas
Andreas,
I don't know if its possible to inline C function within assembly (I think not), but you can make a call to a C function from assembly, using LCR as you noted before.
.global _func1
....
LCR #_func1
Maybe someone else will comment on the inlining.
andreas von kaenel said:right now I think what I would like to do is even impossible
That's correct. It's impossible.
Thanks and regards,
-George