


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of procedures in assembly and high-level languages, focusing on powerpc architecture. It covers application binary interfaces, calling conventions, recursive calls, and examples. The document also discusses the powerpc isa features for procedure calls and the use of the stack.
Typology: Study notes
1 / 4
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