CS 207
Midterm 1
Ondich
Due on paper at 8:30 AM Friday, October 17, 2003

For this exam, you may use your textbook, the Internet, your notes and assignments, your brain, and divine guidance if available. You may not use other people. If you get stuck, talk to Jeff Ondich, but please don't talk to anyone else about the exam.

  1. (12 points) Consider the following PDP8/E program.

    *0200
            CLA OSR
            DCA A
    LOOP,   DCA N
            TAD A
            SNA
            HLT
            CLL RAL
            DCA A
            RAL
            TAD N
            JMP LOOP
    
    A,		0
    N,		0
    

    The following table shows the execution times for all of the PDP8/E instructions (not including op-code 6).

    
    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)
    --------------------------------------------------------
    

    And now, the questions. Assume throughout these questions that the switch register is set to octal 1357.

  2. (6 points)

  3. (4 points) Suppose somebody came up with a hardware device for the PDP8 to do multiplication quickly, and the instruction set designers wanted to add a MUL instruction to the instruction set. Assuming that op-code 6 is all used up with I/O instructions, how could you add a multiplication instruction without changing any of the existing instructions? Describe both your MUL instruction's behavior and its binary representation.

  4. (6 points) When we looked at the Intel assembly language produced by the compiler for a simple C++ program, we saw that the assembly version used both a frame pointer and a stack pointer to keep track of stack frames. That is, one register (the frame pointer) stored a pointer to the bottom of the current stack frame, and another register (the stack pointer) stored a pointer to the top of the current stack frame.

  5. (2 points) Who are Federico Faggin and Howard Aiken, and what importance did they have in the history of computer architecture?

  6. (2 points) I just finished a book, and I'm not sure what to read next. Please give me a suggestion. Thanks.

  7. (9 points) Consider the program stackframes.cpp. Compile it and run it. Then compile it with the command "g++ -S stackframes.cpp". This will create the (Intel) assembly language program stackframes.s, which you can examine to help you answer the following questions.

  8. (4 points) Show how you can use the slt and bne/beq MIPS instructions to implement the pseudo-instruction ble.