Intel ARCHITECTURE IA-32 User Manual Page 544

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 543
Stack Alignment D
D-8
// the goal is to make
esp and ebp
// (0 mod 16) here
j = k;
mov edx, [ebx + 8] // k is (0 mod 16) if
caller aligned
// its stack
mov [ebp - 16], edx // J is (0 mod 16)
foo(5);
add esp, -4 // normal call sequence
to
// unaligned entry
mov [esp],5
call foo // for stdcall, callee
// cleans up stack
foo.aligned(5);
add esp,-16 // aligned entry, this
should
// be a multiple of 16
mov [esp],5
call foo.aligned
add esp,12 // see Note B
return j;
mov eax,[ebp-16]
pop edx
mov esp,ebp
pop ebp
mov esp,ebx
pop ebx
ret 4
}
Example D-2 Aligned ebp-based Stack Frames (continued)
Page view 543
1 2 ... 539 540 541 542 543 544 545 546 547 548 549 ... 567 568

Comments to this Manuals

No comments