T
T
Timofei Malyshenko2016-11-12 13:46:31
assembler
Timofei Malyshenko, 2016-11-12 13:46:31

How to put a value from a register into memory if the register contains an address?

.cpp :
extern "C" double* __fastcall function(double *x);
.asm :

.386
.MODEL FLAT
.DATA
  x		DD		?
  lnx		DQ		?
.CODE
   @[email protected] PROC
  MOV		lnx, [ECX]
  FINIT
  FLD		lnx
  MOV EAX, OFFSET lnx
  RET
  @[email protected] ENDP
END

Visual studio swears at the line:
MOV lnx, [ECX]
invalid instrution operands
What am I doing wrong and how to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
15432, 2016-11-12
@komnotmr

First from address to register, then from register to memory
MOV EAX, [ECX]
MOV lnx, EAX

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question