Author Topic: Interesting effect when using a stack frame in 64 bit MASM.  (Read 1276 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7419
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
With 64 bit MASM, if you use a normal argument list in a procedure with 4 or less arguments, MASM will write the data to shadow space but if you write the procedure with a stack frame but no argument list, you do not get the shadow space overhead. It means you must write the code so that the registers used to pass the first 4 arguments are in the right place in the source code but it means you can bypass the shadow space overhead if you need to.

Without the shadow space overhead, the overhead calling the procedure is reasonably low,

enter etc ...
sub rsp, whatever

; user code here

leave
ret
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: