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

How to access local C variables in Inline-Assembly?

How do I access local C variables in Keil using ARM inline Assembly?

  • Have you read the section on their site about this - Inline assembler support in the compiler

    There is a big difference from gcc in that you put the name of the C variable into the instruction directly rather than something like %2 for the variable associated with the third output or input asm operand and the compiler will figure out what the constraints are itself.

  • It really depends on whether you are using Arm Compiler 5 (a.k.a armcc) or the Arm Compiler 6 (a.k.a armclang).

    Please read: Inline assembly with Arm Compiler 6 

    Inline assembly in Arm Compiler 6 must be written in GNU assembly syntax while in Arm Compiler 5, it is written in armasm syntax. If you have inline assembly written in armasm syntax, you must modify this to use GNU assembly syntax.

    At the end of the section, there are links to the GCC docs if you need more detail.