Example D-1 Aligned Esp-Based Stack Frames - Intel ARCHITECTURE IA-32 Reference Manual

Architecture optimization
Table of Contents

Advertisement

Example D-1 Aligned esp-Based Stack Frames

void
_cdecl foo (int k)
{
int j;
foo:
push
mov
sub
and
add
jmp
foo.aligned:
push
mov
common:
push
sub
j = k;
mov
mov
foo(5);
mov
call
return j;
mov
add
pop
mov
pop
ret
ebx
ebx, esp
esp, 0x00000008
esp, 0xfffffff0
esp, 0x00000008
common
ebx
ebx, esp
edx
esp, 20
edx, [ebx + 8]
[esp + 16], edx
[esp], 5
foo.aligned
eax, [esp + 16]
esp, 20
edx
esp, ebx
ebx
Stack Alignment
// See Note A
// See Note B
D
D-5

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

Subscribe to Our Youtube Channel

Table of Contents