Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list!
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.
Question: Explain two different approaches to implementing multithreaded applications on a uniprocessor (the keywords cooperative and preemptive should provide a hint).