Write a C function, called simulate, that simulates the execution of Alpha machine language.
The function should be capable of simulating any of the instructions listed in the distributed document alpha.ops.
The simulate function takes two parameters:
The directory ~cs611/public/prog3 contains a stub for the simulate function (in simulate.c), as well as a Makefile and a main routine. This main routine performs a series of tests of the simulate function. The directory also contains a file called hack.s that allows the tests to be directly executed by the Alpha hardware. This allows you to easily see what the correct answers are in advance. To build this version of the program, type "make hack" and then type "hack" to execute it. To build the normal version of the program, type "make" and then type "simulate" to execute it.
You should study the hack.s file and determine how it works. I will ask you about it at the programming portfolio review!
All your code should be placed in the file simulate.c.
Your program will be graded primarily by testing it for correct functionality:
Remember, you may lose points if your program is not properly structured or adequately documented.
Only the distributed test cases will be used for grading this assignment.
Your programs will be graded using an Alpha machine so be sure to test in that environment. (Actually this program will only work on an Alpha!)
Your programs should be submitted for grading from a UNH
CIS Alpha machine (e.g. alberti.unh.edu).
Submit just the single file, simulate.c.
To turn in this assignment, type:
~cs611/bin/submit prog3 simulate.c
Submissions can be checked by typing:
~cs611/bin/scheck prog3
To receive full credit for the assignment, you must turn in your files prior to 8am on Monday October 23. Late submissions will be accepted at the penalty of 5% per day up to one week late.
Remember: as always you are expected to do your own work on this assignment.
Comments and questions should be directed to pjh@cs.unh.edu