Required reading: Chapter 7 of Lion's
Example: see accompanying picture of how v6 layout out of the kernel address space and user address space, and how they are mapped to physical memory.
C-function: JSR r5,csv // csv is defined on 1419 .....
args ra (return address) saved r5 <--- r5 saved r4 saved r3 saved r2 <--- sp
args ra (return address of where to return when C-func completes) saved r5 <--- r5 saved r4 saved r3 saved r2 ra (cret) <---- sp
| pc | <- sp
| pc (=670)| | r5 (=0) | <- r5 (=usize+64. - 2) | r4 | | r3 | | r2 | <- sp
| pc (=670)| | r5 (=0) | <- r5 (=usize+64. - 2) | r4 | | r3 | | r2 | <- sp | pc (=1627)| | r5 (=usize+64. -2) | <- r5 | r4 | | r3 | | r2 | <- sp
| pc (=670)| | r5 (=0) | <- r5 (=usize+64. - 2) | r4 | | r3 | | r2 | <- sp
| pc (=670)| | r5 (=0) | <- r5 (=usize+64. - 2) | r4 | | r3 | | r2 | <- sp | pc (=1638)| | r5 (=usize+64. -2) | <- r5 | r4 | | r3 | | r2 | | pc (=1969)| | r5 (=prev r5) | <- r5 | r4 | | r3 | | r2 | | pc (=2094)| | r5 (=prev r5) | <- r5 | r4 | | r3 | | r2 | <- sp
| pc (=670)| | r5 (=0) | <- r5 (=usize+64. - 2) | r4 | | r3 | | r2 | <- sp | pc (=1627)| | r5 (=usize+64. -2) | <- r5 | r4 | | r3 | | r2 | <- sp
| pc (=670)| | r5 (=0) | <- r5 (=usize+64. - 2) | r4 | | r3 | | r2 | <- sp
| 0170000) | | 0 | <- sp