VM II Discussion
-
When a function is called, how are arguments passed? At least two parts of VM code share the responsibility. Illustrate your explanation using a specific example.
-
Suppose that a function
ken
calls a functionbar
. After the functionbar
finishes, execution needs to return to the place inken
that called it.- What does the caller (
ken
) do to make it possible for control to go to the call site afterbar
finishes? - What does the callee (
bar
) do in order to get the execution to continue inken
? Do not include any extraneous details! Just stick with the basics. - Why is this necessary? Why not take the code that needs to
happen next and just put it after the assembly for the function
bar
?
- What does the caller (