CSCI 2321 (Computer Design), Spring 2021:
Reading Quiz 4
- Credit:
- 12.5 points.
Reading
Be sure you have read, or at least skimmed, section 8 of Chapter 2
and sections A.9 and A.10 (up to the list of instructions) of Appendix A.
Instructions
Answer the questions below using only the course textbook
(i.e., no Web searches).
Please work independently rather than in groups,
and include the Honor Code pledge in what you turn in,
either the full pledge or just the word “pledged”.
(Please put this in the same document as your answers,
so I don't overlook it.)
You may write out your answers by
hand and scan them, or you may use a word processor
or other program, but please submit a PDF or plain text
via e-mail to my TMail address.
(No links to shared files on Google Drive please.)
Please use a subject line that mentions the course and
the assignment (e.g.,
“csci 2321 quiz 4” or
“computer design quiz 4”).
Questions
- (2.5 points)
What if a procedure needs more than four arguments?
How are they passed from caller to callee?
- (2.5 points)
Normally procedures start by pushing $ra onto the stack.
When is this not necessary?
- (2.5 points)
Can you do file I/O in SPIM? How about dynamic memory allocation?
- (2.5 points)
We did example(s) in class and homework of “reverse assembling”
(going from 32-bit encoded instruction to assembly language).
Most of the information you need to do this can be found in the
MIPS reference card at the front of the textbook (or online).
Using that, getting from 6-bit opcode to instruction name
involves a tedious sequential search.
I say the textbook provides an easier way.
Where?
- (2.5 points)
For the load/store instructions discussed in chapter 2,
the memory address is in the form displacement(register).
SPIM provides pseudoinstructions that support other ways to specify
the memory address. What are these other ways?
2021-03-18