Hi,
Anybody knows where to get the ABI of gcc? I want to know which registers (x86) are reserved and clobbered when calling a C function.
Thanks,
J
ABI of gcc?
Hi Junkoi,
Maybe the following url will help you. : http://www.delorie.com/djgpp/doc/ug/asm/calling.html
Basically just push eax, ecx, and edx to save them, then push the function's arguments on the stack then 'call' the C function . GCC does NOT pop the function's arguments, it's up to you to pop them after the call.
2xpc.
Maybe the following url will help you. : http://www.delorie.com/djgpp/doc/ug/asm/calling.html
Basically just push eax, ecx, and edx to save them, then push the function's arguments on the stack then 'call' the C function . GCC does NOT pop the function's arguments, it's up to you to pop them after the call.
2xpc.
GCC implements this abi: registers $s0-$s7, $ra, $at are stored on the stack, all others are scratch... oh wait you were talking about the cdecl ABI. That GCC happens to implement.