flat assembler
Message board for the users of flat assembler.
Index
> Windows > local variable doesn't work, but global works in proc |
Author |
|
LocoDelAssembly 14 Aug 2009, 19:34
Replace the line with "invoke RegisterClassEx, addr wc".
|
|||
14 Aug 2009, 19:34 |
|
Fanael 14 Aug 2009, 20:07
Small explanation: address of local variable cannot be calculated at compile-time (addresses of globals can be), so you must tell FASM (actually, pushd macro) that you want to calculate this address at runtime.
Code: invoke sth, addr foo Code: lea edx, foo ;although I'm not sure about used register push edx call [sth] Last edited by Fanael on 14 Aug 2009, 21:11; edited 2 times in total |
|||
14 Aug 2009, 20:07 |
|
LocoDelAssembly 14 Aug 2009, 20:48
It is all explained here: http://flatassembler.net/docs.php?article=win32
Quote:
Just a small note, even with relocations you will still be able to use "mov reg, some_global", because the executable loader will adjust the immediate operand to point to the actual location. |
|||
14 Aug 2009, 20:48 |
|
Fanael 14 Aug 2009, 21:15
Ahhh, yes... I was led astray by erros like this one:
Code: if $ mod 2 = 0 ;suprise! ;... end if ;... section '.reloc' fixups readable discardable |
|||
14 Aug 2009, 21:15 |
|
sleepsleep 16 Aug 2009, 04:53
thanks guys !! appreciated.
|
|||
16 Aug 2009, 04:53 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.