diff options
Diffstat (limited to 'notes.txt')
-rw-r--r-- | notes.txt | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -26,7 +26,8 @@ Caller: Callee: 1. push R5 (base pointer "BP" in stack for local variables and parameters) 2. Store current stack pointer in R5 (LOAD R5 SP). [R5] now contains the return - address, [R5+i] the i-th parameter and [R5+-i] the i-th local var + address, [R5+i+1] the i-th parameter and [R5+-i] the i-th local var. Param i + is at R5 + i + 1 because BP was pushed too 3. Grow stack for local variables (by SUB SP n) if necessary 4. <function body> 5. LOAD SP R5 (clear local vars) @@ -34,7 +35,7 @@ Callee: 6. RTS (go back to caller) parameter access (i-th parameter): -LOAD R0 [R5+i] +LOAD R0 [R5+i+1] local variable access (i-th local var) LOAD R0 [R5+-i] global variable access |