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

Replacing inline assembler code

Note: This was originally posted on 10th February 2011 at http://forums.arm.com

Hi,

My inline assembler looks like this

asm volatile (
    "MRC p15,0,$[value],c0,c0,1          \n\t"   
    : [value] "=r" (my_value)                                  
    );


Depends on the user input, I want to run different asm code. Is it possible to store the asm instruction in a C buffer than call it like

char *my_asm = "MRC p15,0,$[value],c0,c0,1          \n\t";
asm volatile (
    my_asm
    : [value] "=r" (my_value)                                  
    );


I tried this but no luck. Anyone have any idea on how I can achieve this? Thanks.