CMP220 Exam 2 B
Spring 1998
25 pts
  1. Discuss how to microcode a machine to implement the add macrocode instruction.

  2. 30 pts

  3. Translate for I := 2 to 300 do a[I] := a[I]-a[I-1]; into the class' macrocode. (a is an array of integers at location 1000).

  4. 25 pts

  5. 1. Pushc 5

  6. 2. Pushc 2
    3. Copy 1
    4. Copy 1
    5. Shift 1
    6. Add
    7. Copy 0
    8. Pushc -100
    9. Add
    10. JumpPos 13
    11. Storem 100
    12. Jump 15
    13. Pop
    14. Jump 3
    what does this code store to location 100?

    30 pts

  7. Design a circuit that implements a 3 bit autodecrement register.