Homework 1

22C:116, Fall 2001

Due Friday Aug 31, 2001, in class

Douglas W. Jones

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list!

  1. What is your E-mail address? (If you have more than one, give the address you'd prefer used for class purposes.)

  2. Background: Here are some questions to test your understanding of programming language concepts and computer architecture, at the level expected for success in this course.

    Assume a stack machine, where arithmetic instructions operate on the stack top, and push and pop operations are used to load and store variables. Obviously, the CPU must have a program counter if it is to fetch instructions, and it must have a stack pointer if it is to perform arithmetic.

    Part A: What other register(s) must the machine have if it is to execute C or Pascal programs (all are block structured with, at least to an extent, hierarchic scope rules). Justify each register you propose adding to the machine.

    Part B: What minimum set of addressing modes must be available on the load and store instructions if they are to be useful. Justify each such addressing mode.

    Part C: Are any special registers or addressing modes required in order for this machine to support a heap for dynamic storage allocation? Explain.

    Part D: Are any special registers or addressing modes required if we extend our interest from the realm of block structured languages to object oriented languages such as C++ and Java? Explain.

  3. Background: You are expcedted to have completed an introductory operating systems or system software course prior to this course. You should be able to answer the following questions from this background:

    Question: Explain two different approaches to implementing multithreaded applications on a uniprocessor (the keywords cooperative and preemptive should provide a hint).