CS 207
Midterm 1
Ondich
Due 8:30AM, Friday, October 11, 1996
HAND IN ON PAPER


You may use your textbook, your notes, a computer, and your wits on this exam. You may not other books, Internet resources, or other people. If you have mislaid your copy of chapter two of the PDP8/E book, let me know soon so I can get you another copy. If you have questions, see me in my office (I'll be around on Thursday afternoon and Friday morning) or call me (x4364 or 663-7123) or send me e-mail. I have tried to write an exam you can finish in four or fewer hours. If it looks like you're going to take significantly longer than this, please let me know.

Comment your code, and explain your answers clearly. Have fun.

  1. (15 points) Write a PDP8/E subroutine (called with JMS, not via our CALL and RETURN mechanism) to compute A mod B. More specifically, when the subroutine is called, the AC should contain the address of two consecutive data words, A and B. These words should be interpreted as non-negative 12-bit integers. When the subroutine returns, the AC should contain A mod B.

    Since we're considering 12-bit non-negative integers, you need not worry about the signs of A and B. However, you should return 0 if B is 0.

    Don't try to get fancy. You can compute A mod B by subtracting B from A repeatedly until the remainder is less than B.

  2. (10 points) The table below lists execution times for all the PDP8/E instructions we have used. Please answer the following questions.

    
    Execution times in micro-seconds for PDP8/E instructions
    --------------------------------------------------------
                             Addressing mode     
                  ------------------------------------------
    Instruction                            Indirect with
       Type       Direct      Indirect     auto-increment
    --------------------------------------------------------
    AND            2.6          3.8             4.0
    TAD            2.6          3.8             4.0
    ISZ            2.6          3.8             4.0
    DCA            2.6          3.8             4.0
    JMS            2.6          3.8             4.0
    JMP            1.2          2.4             2.6
    
    Opcode 7          1.2 (addressing mode irrelevant)
    --------------------------------------------------------
    


  3. (3 points) We have a new male kitten at our house. What should we name him?

  4. (10 points)

  5. (10 points)




Jeff Ondich, Department of Mathematics and Computer Science, Carleton College, Northfield, MN 55057
(507) 663-4364, jondich@carleton.edu