<div class="gmail_quote">On 6 January 2012 05:22, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com">newshound2@digitalmars.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 1/5/2012 6:25 PM, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are you talking about for parameter passing, or for local variable assignment on<br>
the stack?<br>
For parameter passing, I understand the x32 problems with aligning the arguments<br>
(I think it's possible to work around though), but there should be no problem<br>
with aligning the stack for allocating local variables.<br>
</blockquote>
<br></div>
Aligning the stack. Before I say anything, I want to hear your suggestion for how to do it efficiently.<br>
</blockquote><div><br></div><div>Perhaps I misunderstand, I can't see the problem?</div><div>In the function preamble, you just align it... something like:</div><div>  mov reg, esp ; take a backup of the stack pointer</div>
<div>  and esp, -16 ; align it</div><div><br></div><div>... function</div><div><br></div><div>  mov esp, reg ; restore the stack pointer</div><div>  ret 0</div></div>