While reading some calling convention in some CPU architecture I read something like
"epilogue and prologue", when a function is called from another function.
What is a function prologue or epilogue?
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.
Wikipedia FTW: https://en.wikipedia.org/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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With