


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



int mult(x, y)
prod = mult (a, b)
return (x * y)
The PowerPC ISA provides the following features to supportprocedure/function calls:• link register (p. 2-11)• bl: branch and link (p. 4-41)• blr: branch to link register (Table F-4)
int func(int a, int b){
return (a + b); } main{
…func(5,6);… }
int func2(int a, int b){
return func(a , b); } main{
…func2(5,6);… }
call stack
or simply
stack
stack frame
(a.k.a.
activation
record
func2func
stack framestack frame
stackpointer high address low address
main
……bl
func …
func
……bl
func …??…
func
Describe the stack and LR contents• right before the first bl• right after the first bl• right after the second bl• after each procedure returns
CR (optional, 1 word)
local variables (optional, var size) function param’s (optional, var size) Padding (make size mult of 8 bytes)
Link Register^ Back Chain
frameheader
highestaddress lowestaddress