Assignment 6, due Feb 27
Part of
the homework for 22C:122/55:132, Spring 2004
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due on Fridays at the start of class, and unless there is what insurance companies call "an act of God", the only exceptions to this rule will be by advance arrangement.
Consider the PDP-8, with its 4 addressing modes and 8 instructions. Given the convention that global memory locations 2 to 6 are available as scratchpads for intermediate values in computations, and the convention that register 7 is the frame pointer (to the first word of the activation record of the current routine). We assume that all local variables are part of the activation record, while global variables have static addresss.
a) load the accumulator with x, where x is a local varriable.
b) load the accumulator with *y, where y is a local variable holding a pointer.
c) load the accumulator with z[i], where is a a small local array and i is a local variable.