MCS-388 Homework 4 (Spring 2001)

Due: April 6, 2001

  1. Do exercise 6.10 on page 382.
  2. Chapter 7 suggests using a control link in each activation record on the stack, which points at the calling activation record. It also suggests using two pointers: top_sp to point at the current activation record, and top to point to the current top of stack. By contrast, the simplified MIPS calling convention we've been working with just uses a single pointer, $sp, and doesn't save the calling activation record's location into the current activation record. Explain why these simplifications are possible.
  3. Do exercise 8.12 on page 509. To generate concrete code, you need to know the answers to several questions: For all these questions, feel free to either pick some concrete numbers (like the 10x20), state them, and then work using them, or give symbolic names to the quantities (like saying the array is NxM, with K bytes per element) and then give answers that have expressions containing these symbolic names, even when they really would be crunched down to a single constant.


Course web site: http://www.gac.edu/~max/courses/S2001/MCS-388/
Instructor: Max Hailperin <max@gac.edu>