CS 207
Due Monday, September 11, 1995

Load the following program into the PDP8 and run it. The program starts at address 0200, and expects the switch register to contain some number N at the time when execution begins. The program computes some number, depending on the value of N, and puts the computed number into the accumulator before halting.

Your assignment is (1) to figure out what this program does, and (2) to comment the code as fully as you can. I recommend that you run the program a few times with a variety of (small) values of N. You should start to recognize a pattern. In class on Monday, we will look more closely at this program, and I'll ask you to shorten it and improve your commenting.


Address          Command      Octal

 0200            CLA          7200
 0201            OSR          7404
 0202            SPA          7510
 0203            CMA IAC      7041
 0204            DCA A        3300
 0205            TAD A        1300
 0206            CMA          7040
 0207            DCA B        3301
 0210            DCA C        3302

 0211     GUTS,  ISZ B        2301
 0212            SKP          7410
 0213            JMP END      5220
 0214            TAD C        1302
 0215            TAD A        1300
 0216            DCA C        3302
 0217            JMP GUTS     5211
 
 0220     END,   CLA          7200
 0221            TAD C        1302
 0222            HLT          7402

 0300     A,     xxxx         xxxx
 0301     B,     xxxx         xxxx
 0302     C,     xxxx         xxxx




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