flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
kidscracker 13 Sep 2005, 18:47
When you create a local variable it use the stack, so the variable itselfi isn't an address, it is a poiter relative to EBP , something like EBP-4, etc. To poit to that variable you must use:
Code: proc proc1 local var1:struct1 lea eax,[var1] ; < eax contains the address of var1 invoke proc2,eax ;< send eax as a parameter endp |
|||
![]() |
|
Madis731 20 Sep 2005, 12:48
You could also use:
Code: proc proc1 local var1:struct1 invoke proc2,[var1] endp |
|||
![]() |
|
Tomasz Grysztar 20 Sep 2005, 12:55
Perhaps you mean
Code: proc proc1 local var1:struct1 invoke proc2,addr var1 endp it's the address of local variable, not the contents of it that he wants to pass to the procedure. The "addr" will work only with extended Win32 headers and will generate the code with LEA similar to the one kidscracker posted. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.