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

strange things on inline assembly

Hello to everyone,
i try to make myself familiar with inline assembly.
Because its easy to place code in RAM.
So i have double speed execution.
Everything works fine normaly but now i found that inline-assembly has differences compared to AARM:
In the following function the MOVEQ is ignored, it is not translated.
Why?

//***************************************************************************
unsigned int my_func(unsigned int x)__ram
{
__asm {
        LDR             R2,=0xFFFF0000
        TST             R0,R2
        MOVEQ   R0,R0,LSL #16

        bx              lr
        }
        return x;
}
//***************************************************************************


There's no error message. But the MOVEQ is not in the dissassembly when i go thru code step by step. There is my programm in red color. There is what CARM has translated in black color. But the MOVEQ instruction is missing in black color. Who knows?

Parents
  • The CARM compiler will be discountinued and therefore you should switch to the RealView Compiler. The following code just works find:

    unsigned int my_func(unsigned int x)
    {
      unsigned int v;
      v = 0xFFFF0000;
    __asm {
            TST             x,v
            MOVEQ   x,x,LSL #16
            }
            return x;
    }
    

    The example in C:\Keil\ARM\RV30\Examples\RAM_Function explains how to locate the function in RAM.

Reply
  • The CARM compiler will be discountinued and therefore you should switch to the RealView Compiler. The following code just works find:

    unsigned int my_func(unsigned int x)
    {
      unsigned int v;
      v = 0xFFFF0000;
    __asm {
            TST             x,v
            MOVEQ   x,x,LSL #16
            }
            return x;
    }
    

    The example in C:\Keil\ARM\RV30\Examples\RAM_Function explains how to locate the function in RAM.

Children
No data