I need to mov the value of eax into a memory position, the pointer is in esp+8 in the stack
with this instructions i get the value OK
mov ebx, dword ptr
mov ,eax

but with this other i couldnt:
mov ],eax

How can i do a simple line of code for this purpose?
Posted on 2003-10-21 06:47:04 by MaRi
mov dword ptr ,eax

or

mov ,eax

this should compile fine..
Posted on 2003-10-21 07:25:14 by wizzra
Because the value in esp is offset to the stack. If you just mov , eax it would be like overwriting the parameter.

I suppose the value in esp+8 is a pointer to some data. So in fact your data is stored in and you can only access it via a pointer, which in turn is a pointer itself. Hope you do understand what I mean.

Anyway, wrong forum. *cough*
Posted on 2003-10-21 07:31:12 by roticv
MaRi?,
What you are trying to do is CASCADED indirect addressing. Other CPUs support this addressing mode, but INTEL does not. It is going to take one instruction for every memory reference in the chain. Your example is two links long, so you are going to need two instructions. Ratch
Posted on 2003-10-21 11:02:56 by Ratch