Hello Simon,
When calling a function:
- compile the arguments and leave them on the stack
- call the function, which expects to find the arguments on the stack
When compiling a function definition:
- reserve the first addresses of variable storage for the arguments
- store the locals after the arguments
In the book, p. 108, this is expressed by saying
- for i = 1,..,m: extend(xi,ti) -- the arguments
- for i = 1,...,n: compile(si) -- this includes the locals declared in si
Regards
Aarne.