函数调用&返回 #
(重点)
- 为什么使用函数
- 代码重用 by 不同输入->返回值
caller & callee
在汇编中 称之为procedure
conclusion
- parameters
- local vars
- return value
- return address
作用域(scope)matters
- 变量命名
形参(former parameter)&实参(actual parameter)
Because the compiler does not know how many variables it will need to allocate dynamically, it reserves a lot of space for expansion.
The stack frame usually includes the following items
-
arguments (parameter values) passed to the routine;
-
return address back to the routine’s caller;
-
caller’s ebp;
-
space for the local variables of the routine- saved registers