flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 25 Jun 2003, 08:24
Stack should be always aligned to 4 in Win32, and misalignment often causes some of system functions to fail - I had the same problem in the earlier versions of fasm, which were ported from DOS, where no stack doesn't need to be aligned.
Maybe we should add some alignment to the "enter" macro, so it'll be automatically avoided? |
|||
![]() |
|
roticv 25 Jun 2003, 09:09
like
Code: add esp, 3 and esp, -4 ? |
|||
![]() |
|
scientica 25 Jun 2003, 14:50
privalov wrote: Stack should be always aligned to 4 in Win32, and misalignment often causes some of system functions to fail - I had the same problem in the earlier versions of fasm, which were ported from DOS, where no stack doesn't need to be aligned. I think it should be implented by default in the enter macro, for win32, I don't if the Penguins get mad in linux if the plates are disaligned (=I don't know how linux treat the issue ![]() ![]() btw, the WinNT systems are especially affected by disaligned stacks iirc. _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
![]() |
|
Tomasz Grysztar 25 Jun 2003, 15:02
It should be something like:
Code: macro enter { rb (4 - ($-dynamic_data) and 11b) and 11b dynamic_size = $ - dynamic_data end virtual enter dynamic_size,0 } |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.