[prev] 30 [next]

Function Calling Protocol (cont)

Example: simple function call

int main()
{
   // x is $s0, y is $s1, z is $s2
   int x = 5; int y = 7; int z;
   ...
   z = sum(x,y,30);
   ...
}

int sum(int a, int b, int c)
{
   return a+b+c;
}