在iOS中内联asm错误(Inline asm in iOS error)
int x; __asm __volatile(“movl%0,%% sp”:“= r”(x)::“%sp”); 我想将sp存储到x。 错误:
error: unexpected token in operand __asm __volatile("movl %0, %%sp":"=r"(x)::"%sp"); ^ :1:13: note: instantiated into assembly here movl r0, %sp ^ 1 warning and 1 error generated.int x; __asm __volatile("movl %0, %%sp":"=r"(x)::"%sp"); I want to store sp to x. The error:
error: unexpected token in operand __asm __volatile("movl %0, %%sp":"=r"(x)::"%sp"); ^ :1:13: note: instantiated into assembly here movl r0, %sp ^ 1 warning and 1 error generated.最满意答案
我找到了我的解决方案:
asm volatile("mov %0, sp \n\t":"=r"(x));I have found my solution:
asm volatile("mov %0, sp \n\t":"=r"(x));更多推荐
发布评论