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 All,
I have a label, say "XXX" in the startup assembly code.
Later if I want to jump to label "XXX" in the inline assembly by using
__asm{ B XXX }
The ARMCC compile in Keil MDK complains "the label XXX is referred but not defined".
How should I work around this problem? Thanks a lot.
Best regards Teddy
Hi Teddy,
You need to define the label in the same function that it's called from as far as I can tell.
For more information - check the user manual: http://infocenter.arm.com/help/topic/com.arm.doc.dui0472j/DUI0472J_armcc_user_guide.pdf#page=302
Hope this helps,
Joe
Dear Joe,
Thanks a lot for your reply!
I am aware of the solution you referred. However, in my case, the problem is that the label, to which the inline assembly code intends to jump to, is not defined within the same function.
Image that you have some startup code written in assembly, which eventually jumps to C code "main". After that in the C code, you would like to jump back to a certain label in the startup code. Right now, I work around by defining a assembly function in the startup code and call this function, then jumps to any label I want. I was just wondering if there is better solution than this sort of "indirect jumping".