We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
- assembler function - C-function - assembler function
__asm void MyAsmFunc1(void) { //do some assembler code } void vMyCFunc1(void) { //do something } void vMyCFunc2(void) { //do something } void vMyCFunc3(void) { //do something } __asm void MyAsmFunc2(void) { //do some assembler code }
Using the debugger stepping through my code I discovered that if calling MyAsmFunc1 then after execution has finished it just goes on executing the MyAsmFunc2 function without this second function ever being called!
Weirdo...
Does any expert know what's going on here?
Henk
__asm void MyAsmFunc1(void) { BX LR }
How about how? (assuming LR is used the same way as on ARM7 devices). You need to read the assembly manual BEFORE YOU START.
many times it's much faster asking stupid questions than just studying manuals with no reference to practice...
using BX LR solves the problem.
Time for me to get really studying the assembler instructions.
Thanks.
Don't mention it. Asking questions is important, but so is, as you mentioned, reading the manual...
Something else that you might find handy is to observe the actual compiler output (see listing tab) with minimum optimizations, comparing it to the original C code.