With the masm "ADDR" operator in the invoke syntax
it's easy to pass addresses to procedures,
but what do i do if i only want to store the address
of an variable in a register?

"mov eax,ADDR var" doesn't work.
Is "mov eax,OFFSET var" really the same in all cases
(flat memory model, of course :) )?

And what about LOCAL variables in procedures,
the offset operator isn't working for them.
I've only a temporay solution: a procedure wich returns the address passed to it. :(

Hope somebody can help me with this basic questions.
Posted on 2001-08-12 11:19:36 by Robert
offset will only work for global data. The offsets of local data are not
known at compile time, because of the nature of the stack....
If you want to have the address of a stack variable in a register,
use the friendly LEA instruction :)
Posted on 2001-08-12 11:25:33 by f0dder
Of course, i forgot locals are on the stack - so it couldn't work!

Thnx :)
Posted on 2001-08-12 11:42:39 by Robert