Note
CS Degree Day 68
What I did today?
- Lecture 9: Stack frames in x86-64
- Lecture 10: Reading and writing basic assembly functions
- Lab: Trace through a C function compiled to assembly
Interesting things I came across
The stack frame discipline
When a function is called: the return address is pushed. The frame pointer is saved. Local variables are allocated by decrementing the stack pointer. Arguments beyond six are passed on the stack. When the function returns, it restores the frame pointer, pops the return address, and jumps. This protocol is followed by every function in every program on every x86 machine. It is the universal handshake of computation.