Intel ARCHITECTURE IA-32 Reference Manual page 544

Architecture optimization
Table of Contents

Advertisement

Example D-2 Aligned ebp-based Stack Frames (continued)
esp and ebp
j = k;
mov
caller aligned
mov
foo(5);
add
to
mov
call
foo.aligned(5);
add
should
mov
call
add
return j;
mov
pop
mov
pop
mov
pop
ret 4
}
// (0 mod 16) here
edx, [ebx + 8]
[ebp - 16], edx
esp, -4
[esp],5
foo
esp,-16
[esp],5
foo.aligned
esp,12
eax,[ebp-16]
edx
esp,ebp
ebp
esp,ebx
ebx
Stack Alignment
// the goal is to make
// k is (0 mod 16) if
// its stack
// J is (0 mod 16)
// normal call sequence
// unaligned entry
// for stdcall, callee
// cleans up stack
// aligned entry, this
// be a multiple of 16
// see Note B
D
D-8

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ARCHITECTURE IA-32 and is the answer not in the manual?

Questions and answers

Table of Contents