How to specify an individual register as constraint in ARM GCC inline assembly?

前端 未结 2 428
孤街浪徒
孤街浪徒 2020-12-04 02:35

in x86 inline assembly i can write something like this:

asm (\"cpuid\"
            : \"=a\" (_eax),
              \"=b\" (_ebx),
              \"=c\" (_ecx),         


        
2条回答
  •  没有蜡笔的小新
    2020-12-04 03:06

    I don't think gcc for ARM allows you to use constraints to specify exactly which register to use. However, you can use explicit register variables to specify a register to store a variable in:

    register int my_variable asm("r0");
    

提交回复
热议问题