Assignment 6, due Feb 27

Part of the homework for 22C:122/55:132, Spring 2004
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

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.

  1. The first step in evaluating a computer architecture is to evaluate whether it is, in fact, a general purpose machine. For a Von Neumann architecture, this means verifying that its memory addressing is sufficiently general to allow all possible data and control structures to be exploited.

    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.

  2. Draw the data paths through the PDP-8 ALU that you can infer from the microcoded instructions of this machine. (You can infer quite a bit from this!)

  3. The PDP-8 allows very efficient code for some operations. Consider the problem of copying an array of size S from location A to location B in memory, given that A and B are pointers stored in page 0 of memory and S is a constant, also in page 0 of memory. You can do this most efficiently using autoincrement addressing and the increment and skip if zero instruction. Work out the code to do this. (Hint, the setup for the loop takes something like 7 instructions, and the loop itself is about 4 instructions total.)

  4. The PDP-11 had a general source-to-destination move instruction. Formulate the version of this instruction that takes the maximum possible number of memory references (assuming a 16-bit path to memory), and itemize those memory references - which is the instruction fetch, what other operands are fetched from the instruction stream, what operands are fetched from memory, and what operands are stored in memory?

  5. What does the PDP-11 instruction MOV -(PC),-(PC) do? Explain how this goes into an infinite loop and what the side effects of this loop are on the contents of memory.