flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > addresses of locals |
Author |
|
JohnFound 21 Feb 2005, 23:18
asimov wrote: What have I missed, or is it not possible to pass addresses of locals? You missed that the address of local variable is not a constant, but relative to the register ebp i.e. ".ldat" == "ebp+const". So, there is no push instruction that can push this address directly. Use "lea" instruction instead: Code: lea ecx, [.ldat] stdcall subroutine, eax, ecx, 1 For example MASM allows directly pushing of local variables in the "invoke" macro, but it uses eax and mutually do the same "lea eax, ldat | push eax". I think that using "lea" is more readable. Regards. |
|||
21 Feb 2005, 23:18 |
|
asimov 22 Feb 2005, 18:34
Thanks for the reply. I got it now Duh, should have thought of that!
|
|||
22 Feb 2005, 18:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.