As per your comment, your function gets a double*
argument. Thus 4(%esp)
is a pointer to double, that is the base address where your array items are stored, at 8 bytes each. To access the i
-th element, multiply i
by 8 and add it to said base address. Assuming i
is in eax
you can load this element into the FPU like so:
movl 4(%esp), %edx # load array base
fldl (%edx, %eax, 8) # load the array item whose index is in eax