Page 14 - Prosedur
P. 14
Fungsi Swap
Memanggil swap dari call_swap
int zip1 = 15213;
int zip2 = 91125; call_swap:
• • •
pushl $zip2 # Global Var
void call_swap() pushl $zip1 # Global Var
{ call swap
swap(&zip1, &zip2);
} • • •
•
void swap(int *xp, int *yp) • Stack
•
{ diperoleh
int t0 = *xp; int
t1 = *yp; &zip2
*xp = t1; &zip1
*yp = t0; %esp
} Rtn adr