gpt4 book ai didi

ios - iOS 错误中的内联汇编

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:22:45 24 4
gpt4 key购买 nike

整数 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.

最佳答案

我找到了我的解决方案:

asm volatile("mov %0, sp \n\t":"=r"(x));

关于ios - iOS 错误中的内联汇编,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18095069/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com