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

Branch to a label in inline assembly

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

Parents
  • 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
    }
    
Reply
  • 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
    }
    
Children