I am trying to use CL 16.0 for x64 (VS 2010) to create some readable 64-bit ASM code for an example, but CL insists on predetermining a ton of stack space (28 bytes) with the following line:
sub rsp, 40 ; 00000028H (actual value depends on number of local vars of course)
The question is, how can I disable this behavior? It's hard to explain to the class, and I like to show them clean, explainable code ... My assumption is that "sub rsp, XXX" should allocate the exact space required by local variables in the function.
Of course, this does not require additional space. On x86, this behavior is apparently controlled by the edit-and-continue switches (/ Zi vs. / ZI), but they have no effect in the case of x64. Any idea how to make x64 CL allocate as many stack as required?
Thanks in advance!
source share