I need to use 'call' instead of 'invoke'.

How can I convert the following snippet to push the address of '_st' ?

Thanks for your help.


init proc
local _st:SYSTEMTIME
local temp:dword
invoke GetSystemTime,addr _st
Posted on 2002-11-27 11:55:27 by flyingtiger
If it wasn't a local you could do:

init proc
local _st:SYSTEMTIME
local temp:dword

push offset _st
call GetSystemTime

Now you have to:

init proc
local _st:SYSTEMTIME
local temp:dword

lea eax,_st
push eax
call GetSystemTime

Haha Mirno, beat you :)
Posted on 2002-11-27 12:11:05 by Qweerdy
If its a global struct "push offset whatever" - because the assembler can determine the address at assemble time.

If its local "lea eax, whatever" followed by "push eax" - because the address is not known, but is relative to ebp, so this will assemble to "lea eax, "

Posted on 2002-11-27 12:11:29 by Mirno
Hi Qweerdy, Mirno,

Thanks to both of you for your help.

Where can I learn all about these neat tricks (local, global, struct...) ?

Posted on 2002-11-27 12:23:48 by flyingtiger
Reading other people's source, mostly. It's all in \masm32\help\masm32.hlp too, though. May be a bit much too read all of it, but it's a good reference.

In fact, when you open it and click the topmost link ("Using invoke"), you'll see "addr" and "offset" explained right there :)
Posted on 2002-11-27 12:40:33 by Qweerdy
Maybe try the MASM documentation, though i forgot the site. But i can post it online.
Posted on 2002-11-27 19:27:28 by roticv
Please post the url.


Posted on 2002-11-27 19:35:44 by flyingtiger