hi ,
While reading some calling convention in some CPU architecture i read something like
"epilog and prolog" , when a function is called from another function.
Can anybody give more inputs on this?
/renjith_g
hi ,
While reading some calling convention in some CPU architecture i read something like
"epilog and prolog" , when a function is called from another function.
Can anybody give more inputs on this?
/renjith_g
Wikipedia FTW: https://secure.wikimedia.org/wikipedia/en/wiki/Function_prologue
This seemed to explain it fairly well, in my opinion. If there is anything that is unclear, let me know and I can try and clear things up.
The epilogue and prologue of a function are simply the set of instructions that 'set up' the context for the function when it's called and clean up when it returns.
The prologue typically performs such tasks as:
The epilogue generally only needs to restore any save registers and restore the stack pointer such that any memory reserved by the function for its own use is 'freed'.
The exact mechanisms that might be used in a prologue/epilogue are Dependant on the CPU architecture, the platforms standard, the arguments and return values of the function, and the particular calling convention the function might be using.