Im trying to understand what this x86 instruction is doing:
movl %eax, heap(,%rdx,4)
This is what I think its doing:
move value in eax to area in memory starting at label heap and displaced bytes from the value in rdx.
Is this correct?
Thanks
The AT&T syntax for memory operands is:
%segreg:disp(base,index,scale).
So the memory address in the instruction you've shown is (better represented in Intel syntax):
heap[rdx*4]
So in other words, store the value in eax at rdx*4 bytes from the beginning of heap. From this, we can infer that heap is probably an array of 4-byte integers, and rdx is a loop counter or index into that array.
In Intel syntax, this would be:
mov heap[rdx*4], eax
For a comparsion between the syntaxes, see this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With