Assigned 10/18/96, due on paper on 10/23/96.
Do problems 1, 2, 11, 13, 25, 31-33 from Chapter 4 of Hennessy and
Patterson.
In addition, explain in detail the function-calling conventions
used by the C compiler "cc" on our SGI's (green, blue, and cyan.mathcs.carleton.edu). Among the questions you might
address are:
- What is the structure of the stack frames?
Where do local variables go, and in what order? Where does
the return addresss go?
- How are parameters passed? What if there are more than
four of them? What if one is too big to fit in a register?
Are floating-point parameters passed in the integer registers?
- How and where is the return value returned? What if it
is too big to fit in a register?
- Whose responsibility (caller or callee) is it to allocate
and deallocate space on the stack for the stack frame?
The main technique I would use to investigate these questions
is to write lots of little C programs and compile them
to assembly using "cc -S". If you are not familiar with C,
please talk to me. Have fun.