for the assembly sages here can you point out something im missing here... I've been wanting to pickup x86 assem, and in the compilation of the following C code, I've run into something I don't understand.
Looking at the C code; a function inside the main function is using mains parameters. Not really interested in what it does, but looking at the corresponding assembly (unoptimized compilation btw) we have standard prologue and a 16 byte allocation onto the stack, cool, we have 2 params this is x64 assem makes sense since the memory addresses of the params are 8bytes respectively.
I don't get the offsets chosen by the compiler, shouldn't the first&second move instruction be:
"mov DWORD PTR [rbp], edi";
"mov DWORD PTR -8[rbp], edi";
Wouldn't the second ptr be exceeding the stack frame? Sorry for the lengthy post, and thanks for your help.