how is the value of 28h
(decimal 40) that is subtracted from rsp
calculated in the following:
option casemap:none
includel
I believe it's because before main
is called, the stack is aligned. Then after the call
, the act of the call
was to push an 8-byte pointer (address of the caller) onto the stack. So at the beginning of main
, it's 8 bytes off of the 16-byte alignment. Therefore, instead of 20h
you need 28h
, bringing the actual total to 28h + 8h
(from the call
) or 30h
. Alignment. :)