I am currently accessing an array like this:
ARRAY: .long 1,2,3,4
# put index in register ebx
mov $4, %ebx
# put nums value in eax
mov nums(,%ebx,4), %eax
Is it possible to, instead of using a register for the array to use an address on the stack? For example if I have the value 4
stored at %rbp-4
, something like:
mov nums(-4,%rbp,4)