This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cortex-M3 calling c functions from assembly

Hi,
We are trying to call a 'C' function from assembly code and are not terribly successful (i.e won't assemble). Does anyone know how this is done or know of any links to example(s) of how this is done? We are using Keil RealView compiler as well as the ARMASM assembler.

Thanks in advance,
Glenn

Parents
  • Thanks for the response.
    More specifically, how can an assembly language program gain access to a C functions address? Have tried the EXPORT directive (but compiler complains), tried the "--asm" compiler switch but again the compiler complains, used the underscore naming convention, but the assembler complains. As far as parameter passing and such yes, creating a small 'C' program that calls this function and looking at the disassembly is the way to go. Maybe I could save the disassembly somehow (can't find a PRAGMA statement to do this). It seems as though it should be in the docs, I just haven't seen it.

Reply
  • Thanks for the response.
    More specifically, how can an assembly language program gain access to a C functions address? Have tried the EXPORT directive (but compiler complains), tried the "--asm" compiler switch but again the compiler complains, used the underscore naming convention, but the assembler complains. As far as parameter passing and such yes, creating a small 'C' program that calls this function and looking at the disassembly is the way to go. Maybe I could save the disassembly somehow (can't find a PRAGMA statement to do this). It seems as though it should be in the docs, I just haven't seen it.

Children