Saint Louis University |
Computer Science 140
|
Dept. of Math & Computer Science |
Topic: Machine Language
Related Reading: Ch. 2.1-2.3, and Appendix C
Due:
8pm Tuesday, 3 October 2006
For this assignment, we will rely heavily on the CPU Simulator software demonstrated in class. You will need to have an external Internet connection to run this software.
Complete
Complete
Complete
2 Oct 2006: Uh oh.
The description for this problem was designed using the example
of code from Problem 17 on page 112 of the book.
Unfortunately, when typing up the assignment I accidentally said
to use Problem 20 on page 113.
If you have not already done this problem, I prefer to have you use Problem 17, and so I am writing the rest of this description assuming that you do so. However if you have already worked through the problem with the code for Problem 20 and are comfortable with your answer, feel free to submit that answer and I'll grade it.
Consider the program which is specified in
Demonstrate the execution of each individual instruction as follows. Give a table as follows, showing the values of the Program Counter(PC), Instruction Register(IR), and the first three general purpose registers, as each exists at the end of each fetch phase of the machine cycle. Continue until the machine halts (it shouldn't be too long...)
PC IR R0 R1 R2 -- ---- -- -- -- 00 2003 00 00 00 02 2101 03 00 00Notice that the first line shows the state of the three registers at the point when the first instruction has been fetched, but not yet executed.
Overall, please type your answers to all of the problems in a single document to be submitted electronically. Please see details about the submission process.
In class, we examined a program which computed the absolute value of the number originally stored in memory address 20 and it writes that result to address 21.
Here, we want you to write a program which computes the absolute value of the difference between the values stored in address 20 and address 21. You should write this result to address 22.