我有一个 long 数组(大小 4),我想将这 4 个值中的每一个存储到它自己的单独寄存器中。但我不确定如何做到这一点,因为我从未在汇编中使用过数组。例如,我想存储array[0]
into r9
、array[1]
intor10
等。有人可以帮我这样做吗?到目前为止,这是我的代码。lhs
是指向数组的指针。
define(lhs,%rdi)
define(rhs_d,%esi)
define(rhs,%rsi)
define(result,%rdx)
.text
.globl addBignumInt
.type addBignumInt, @function
addBignumInt:
.LFB18:
.cfi_startproc
# code goes here
movslq rhs_d, rhs
.cfi_endproc
.LFE18:
.size addBignumInt, .-addBignumInt
所以,基本上我想做的是,
movq lhs[0], %r9
但显然这是不正确的