Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在汇编中,我试图将 32 位从内存添加到 64 个寄存器,这将加载 64 位:
add arr(,%rax,4), %rbx
所以我尝试了:
这没有用。
我该如何解决这个问题?
您不能直接执行该操作,而是分两步执行:首先您需要将您的值零扩展到一个附加寄存器中,然后您可以将其用于加法。
这样的事情应该做的工作:
movl arr(,%rax,4), %edx add %rdx, %rbx