   Function Stack Frames
  Hi, i have a question:Are the params which are to be pushed onto the stack before a function is called added to the function´s local size?in my compiler, it works without adding it.consider this example:   void test(int a, int b){    int x = a + b;}void main(){  test(10, 20);}my compiler assembles it to:   test0:pushebp1:movebp, esp2:subesp, 8   // only size of local x and temp, not the params!!!! works!!!3:mov[ebp-8], [ebp+12]4:add[ebp-8], [ebp+8]5:mov[ebp-4], [ebp-8]6:addesp, 87:retmain8:pushebp9:movebp, esp10:subesp, 011:push2012:push1013:call0(test)14:addesp, 015:haltPlease NOTE: This is no real x86 machine code, it is rather my own virtual machine code which looks a bit like x86[edited by - Gammastrahler on February 12, 2004 5:00:10 PM][edited by - Gammastrahler on February 12, 2004 5:00:49 PM]
  I''m not sure what you mean by "local size" of the function. Do you mean the amount of space the function uses on the stack?As you said, the assembly is creating space on the stack for the local x, and a temporary. But it is also pulling the parameters from earlier on the stack, so you could still consider it to be "using" more than just the 8 bytes it set aside. ;  By the function´s local size, i mean only the size required for the local variables (in this case, x and the temporary). but i was wondering if i need to explicitely add (or sub) the 4 bytes for the argument, ie:sub esp, 12instead ofsub esp, 8or is it sufficient to only make room for 8 bytes since the argument is already pushed on the stack? 