
Stack Alignment
D
D-5
Example D-1 Aligned esp-Based Stack Frames
void _cdecl foo (int k)
{
int j;
foo: // See
Note A
push ebx
mov ebx, esp
sub esp, 0x00000008
and esp, 0xfffffff0
add esp, 0x00000008
jmp common
foo.aligned:
push ebx
mov ebx, esp
common: // See
Note B
push edx
sub esp, 20
j = k;
mov edx, [ebx + 8]
mov [esp + 16], edx
foo(5);
mov [esp], 5
call foo.aligned
return j;
mov eax, [esp + 16]
add esp, 20
pop edx
mov esp, ebx
pop ebx
ret
Содержание ARCHITECTURE IA-32
Страница 1: ...IA 32 Intel Architecture Optimization Reference Manual Order Number 248966 013US April 2006...
Страница 220: ...IA 32 Intel Architecture Optimization 3 40...
Страница 434: ...IA 32 Intel Architecture Optimization 9 20...
Страница 514: ...IA 32 Intel Architecture Optimization B 60...
Страница 536: ...IA 32 Intel Architecture Optimization C 22...
Страница 560: ...IA 32 Intel Architecture Optimization E 14...