long mode calling convention
Posted: Sat Jan 24, 2009 8:48 am
Hi, is there a way to change GCC's long-mode calling convention to act more like the protected-mode calling convention?
When calling a function in protected-mode, all parameters passed to the function are pushed onto the stack before calling the function. In long-mode, the parameters are put in registers before the function call, then the function itself puts the values of those registers on the stack.
I looked around in GCC's documentation but didn't find anything... though I was only skimming through it quite quickly so I might of missed something. Hopefully theres a #pragma that'll do it, that way you could be selective and use the long-mode calling convention for assembly functions etc.
When calling a function in protected-mode, all parameters passed to the function are pushed onto the stack before calling the function. In long-mode, the parameters are put in registers before the function call, then the function itself puts the values of those registers on the stack.
I looked around in GCC's documentation but didn't find anything... though I was only skimming through it quite quickly so I might of missed something. Hopefully theres a #pragma that'll do it, that way you could be selective and use the long-mode calling convention for assembly functions etc.