Even though most programming is now carried out in high level languages, a good understanding of the generated assembly code really helps in debugging, performance analysis and performance tuning.
In this article, we will discuss the assembly code generated for function calling, parameter passing and local variable management. Frame pointer operations in a function call are described in detail.
We follow the lifecycle of a function call:
- Pushing parameters
- Invoking function
- Setting up the frame pointer
- Dismantling the frame and restoring the callers frame at function exit
- The caller popping the parameters.