a.

main()

{

leaf_function(1);

}

<!--[if !supportEmptyParas]--> <!--[endif]-->

int leaf_function (int f)

{

int result;

result = f + 1;

if (f > 5)

return result;

leaf_function(result);

}

b.

int my_global = 100;

main()

{

int x = 10;

int y = 20;

int z;

z = my_function(x, my_global);

}

<!--[if !supportEmptyParas]--> <!--[endif]-->

int my_function(int x, int y)

{

return x - y;

}


4.1 각 함수를 call한 후에 스택과 스택 데이터 세그멘트의 내용을 보이시오.

4.2 위 프로그램에 대하여 MIPS 코드를 작성하시오.

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

4.3 leaf 함수가 Temporary 레지스터 ($t0, $t1, etc)를 사용할 수 있었다면, 위 프로그램에 대하여 MIPS 코드를 작성하시오.


문제가 이거인데 4.2 4.3은 먼말인지 손도 못대겟도;;

4.1에서 (a)의 스택은 7인거같고  스택ㅇ데이터 세그멘트는 먼지몰겟고ㅠㅠ


형들아 도아주세요!!