CS611
Programming Assignment 3
Fall 1998


Write a C function that disassembles Alpha machine language.

The function should be capable of disassembling any of the instructions listed in the distributed document alpha.ops. If while disassembling you encounter an instruction not on this list, simply place "unknown" (and the hex value of the instruction) in the output buffer.

The output format should be identical to the format used in the "Example" column in the "alpha.ops" document. Registers should be displayed with `$num' notation where `num' is decimal. Displacements and immediate constants should be in decimal. The opcode should be placed in the buffer first (with no preceding spaces). The operands should be separated from the opcode by one space. Operands should be separated by commas (with no spaces). It is important to follow these formatting rules since we will be using the "diff" program when we do the grading.

The directory ~cs611/public/prog3 contains a stub for the function in disassemble.c. The directory also contains the "alpha.ops" document, a main program, four test files. and a Makefile for building and testing your program. One test file contains only Memory format instructions, one contains only Operate format instructions, one contains only Branch format instructions, and one contains only jsr and ret instructions. Each test file will be worth equal credit and these test files will be the only ones used for grading. (The directory also contains a program, create-data, for creating test data from Alpha assembler input. The create-data program must be run on a Alpha processor.)

You may lose points if your program is not properly structured or adequately documented.

Your programs will be graded using an Alpha machine (e.g. alberti) so be sure to test in that environment.

Your programs should be submitted for grading from either alberti, hopper, or christa. To turn in this assignment, type:

~cs611/bin/submit prog3 Makefile disassemble.c main.c

Turn in Makefile and main.c even if you did not change them.

Notes:

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 19. 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.


Last modified on August 30, 1998.

Comments and questions should be directed to pjh@cs.unh.edu