0

So if eax is the return of a double* (the address to a double) how would one put the value of a double (REAL8) into that location?

At the moment my code is as follows

    call getDouble; c++ extrn that returns double
    fstp tempDouble
    call newDouble; c++ extrn that returns a new double*
    lea edx, tempDouble
    mov REAL8 [eax], [edx]

The last line is that keeps giving me issues. EAX has the double* value (address to a memory block to a new double) and EDX has the address to a double variable. I'm trying to copy the value stored at the EDX address to what's at the EAX address.

  • [x86 does not support memory-to-memory MOV operations](https://stackoverflow.com/questions/11953352/why-ia32-does-not-allow-memory-to-memory-mov) – Raymond Chen Dec 15 '20 at 02:22
  • @RaymondChen is it possible to send a set value to the memory location then? like "mov REAL8 [eax], tempDouble" in place of the last two lines? – Nicholas Hoy Dec 15 '20 at 02:38
  • 1
    You can look in the instruction manuals for the types of things that can be MOV'd. The traditional way of doing a memory transfer is to load into a register from the source and then store to the destiation – Raymond Chen Dec 15 '20 at 04:35

0 Answers0