flat assembler
Message board for the users of flat assembler.
Index
> Windows > Win64: Stack 16-byte alignment question |
Author |
|
revolution 18 Dec 2011, 13:22
yoshimitsu wrote: Am I understanding something wrong or does EVERY API-function has a leading "push rbp" which therefore gets the stack 16-byte aligned again? |
|||
18 Dec 2011, 13:22 |
|
yoshimitsu 18 Dec 2011, 13:27
hehe, that was fast.
So if I'm writing my own function which should call API-functions but does not need to access via rbp and thus doesn't push it at the beginning, it's mandatory, though, that I decrease rsp by 8? And on the other hand, if I am using rbp (by using FASM's proc-macro) I have to take it into account when allocating space for the parameters for functions and shouldn't forget that ebp already realigns the stack which is why I then must not add a nonparity power of 8, but a parity one (means 16-byte aligned)? |
|||
18 Dec 2011, 13:27 |
|
revolution 18 Dec 2011, 13:44
yoshimitsu wrote: hehe, that was fast. The most common trap with an unaligned stack is the XMM register values. If they are not saved to 0 mod 16 then you can get problems. But most other stuff is fine with the less strict 0 mod 8. |
|||
18 Dec 2011, 13:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.