void g(void);
void h(int);
int f(int a) {
int b = a+1;
g();
h(b);
return b+2;
}
void f(int);
void h(int y) {
int x = y+1;
f(y);
f(2);
}
void h(int, int);
void m(int x, int y) {
h(y,y);
h(x,x);
}
Clearly, if arguments to m(x,y) arrive in registers r1
and r2, and arguments to h must be passed in r1
and r2, then x cannot stay in r1 during the
marshaling of arguments to h(y,y). Explain when and how the C
compiler moves x out of r1 so as to call h(y,y).
int g(int, int *);
int f(int a, int b) {
int c[3], d, e;
d = a+1;
e = g(c, &b);
return e+c[1]+b;
}
int leaf(int a, int b, int c, int d, int e, int f, int g, int h) {
return a+b+c+d+e+f+g+h;
}
int foo(void);
int nonleaf (int a, int b, int c, int d, int e, int f, int g, int h) {
int x = foo();
return a + b + c + d + e + f + g + h + x;
}
Then identify all the components of the calling sequence and explain what each
line of assembly language does (including the pseudo-instructions).