assembly - Access array indices on x87 stack -
i'm having difficulty assembly syntax. in assignment, required pass series of parameters x87 floating point register. 1 of parameters double, , we're supposed use double array.
i've loaded stack using fldl 4(%esp), have task of accessing array elements. know , understand syntax manipulate integer arrays in x86, don't understand how access indices of array while it's on x87 stack.
because it's thing on floating point stack, know can found @ %st(0)
as per comment, function gets double* argument. 4(%esp) pointer double, base address array items stored, @ 8 bytes each. access i-th element, multiply i 8 , add said base address. assuming i in eax can load element fpu so:
movl 4(%esp), %edx # load array base fldl (%edx, %eax, 8) # load array item index in eax
Comments
Post a Comment