0
mov eax,5

for: ;(future tag for loop)
call Putere
movsd xmm2,xmm1
div xmm2,eax
movsd xmm0,xmm2

xmm1 correctly calculates a variable x raised to the power of eax. eax will be the index for a loop and I need to divide xmm2 by eax at every step until 0. Is there any way to do this without having to change all my registers into float registers? (I am also using ebx inside the function Putere as a loop index)

3
  • 1
    The legacy x87 FPU has an fidiv instruction to divide ST(0) by a 16bit or 32bit integer. But (afaik) there is no instruction to divide a xmm register (directly) by an integer. Commented Apr 30, 2024 at 14:25
  • 4
    You will need to convert for the division at least. See CVTSI2SD Commented Apr 30, 2024 at 14:26
  • Using CVTSI2SD worked thank you so much Commented Apr 30, 2024 at 14:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.