How to put a value from a register to memory if the register is the address?

.cpp :
extern "C" double* __fastcall function(double *x);
.asm :
.386
.MODEL FLAT
.DATA
 x DD ?
 lnx DQ ?
.CODE
 @function@4 PROC
 MOV lnx, [ECX]
FINIT
 FLD lnx
 MOV EAX, OFFSET lnx
RET
 @function@4 ENDP
END

Visual studio swears by line:
MOV lnx, [ECX]
invalid operands instrution
What am I doing wrong and how to do it properly?
July 2nd 19 at 17:32
1 answer
July 2nd 19 at 17:34
Solution
First, from the address register, then from the register into memory

MOV EAX, [ECX]
Lnx MOV, EAX
How the content of the double type( 8 bytes) to the address lying in ECX will fit in the EAX register, which can accommodate a total of 32 bits ? - tre24 commented on July 2nd 19 at 17:37
if the code is 64-bit, you can use RAX instead of EAX
otherwise - in two parts

MOV EAX, OFFSET lnx
MOV EBX, [ECX]
MOV [EAX], EBX
MOV EBX, [ECX+4]
MOV [EAX+4], EBX - turner.Beahan commented on July 2nd 19 at 17:40

Find more questions by tags Assembler