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
Dear Ronan,
Thanks a lot for your reply!
I have tried. It seems that declare a label as "extern" is not possible.
Hi Teddy,
My apologies - I see you are using the inline assembler, this is very limited in functionality (and support for this is deprecated).
A better solution is to use the embedded assembler, which works something like (I'm writing this remotely without access to my tools...):
extern void bar(); __asm foo() { BL bar BX LR }
Hi Ronan,
Something in your code I dont clearly understand.
If the function bar is defined in the external assembly code, then your function foo shouldnt be necessary anymore. Because you can simply call bar in the C code.
Yes my example was trivial, just to show how you can reference the symbol. Of course you would add other code to this to do something meaningful.