In-depth: Windows x64 ABI: Stack frames

Information
2012-Oct-01 | Tags: learnprograming

Start64!All of the disassembly I'll show you is from Visual Studio 2012 Express. Comments I make about MSVC are referring to that version as well. If you're following along at home with 2010, you won't see any differences with the compilation of my example code.

I've seen 2012 store non-volatile registers in function prologues and take advantages of tail calls more often, but these are simple examples and result in the same disassembly so long as you use the same compiler options.

Stack frame anatomy

This is what the common Windows x64 stack frame looks like without optimizations. The stack grows upwards, and the numbers in the block are the sizes that it can be:


facebook-3 twitter-3 rss-3 email-3

logo-bottom