CS 207 Assignments

  1. Assignment #1

  2. Assigned 9/11, due 9/15. Write a PDP8/E subroutine that multiplies two integers. Before calling your subroutine by means of a JMS instruction, you should put the factors in two consecutive memory locations, and store the address of the first factor in the AC. Your subroutine should put the product of the factors in the AC before returning. Your subroutine should function correctly for both positive and negative integers, but need not concern itself with overflow.

    To call your subroutine, you might use a program like this:

    
              CLA OSR
              DCA A
              HLT
              CLA OSR
              DCA A+1
              TAD ADDR_A
              JMS MULT
    
    A,        0000
              0000
    ADDR_A,   A
    
    
    where A is the address of the first factor and MULT is the address
    of your subroutine.

  3. Assigned 9/11, due 9/20. Write a PDP8/E program that clears as much of memory as possible ("clearing" a memory location means setting it to 0). If your program clears all of memory--including the program itself--you'll get an A+. If you leave one location uncleared, you'll get an A, two uncleared, A-, and so on.

  4. Assigned 9/15. Read Chapters 1 and 2 of Tanenbaum.

  5. Assigned 9/18, due 9/22. Write a program to compute the Nth triangular number using recursion. Your main program will get N from the switch register and call a recursive procedure with N as its parameter. The recursive procedure, upon the return to the main program, will have left the Nth triangular number (T(N) = 1 + 2 + ... + N) in the AC.

    For more details, come to class on 9/18.

  6. Assigned 10/24, due 10/27. Submit to Aric Stewart via e-mail at stewarar@mathcs.carleton.edu. Look here for the assignment.
  7. Assigned 10/30, due 11/3. Submit to Aric Stewart via e-mail at stewarar@mathcs.carleton.edu. Take this program and rewrite it with the goal of improving its performance. Your first step should be to time the program a few times as it stands, for various values of MAX_ATTEMPT. Then, modify the code using only C manipulations--adding "register" to the declarations of judiciously selected variables, reorganizing loops, etc. Time the resulting code and see whether you've improved the performance. Finally, take your faster version of the program and modify it by replacing some of the C code with assembly code. Again, time your results.

    Hand in your two modified source files, measurements of the performances of the three programs, and your interpretation of your data.





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