Assignment 6, due June 30Machine Problem 3, due July 6
Part of
the homework for 22C:50, Summer 2004
|
Create a working directory called mp3, and then either: Install the source code from
http://homepage.cs.uiowa.edu/~dwjones/syssoft/hw/mp0.txtOr make a copy of your solution to MP1 or MP2 to this directory and continue development here, so you end up with your solutions integrated into one program.
Having done this, note that the assembler, as currently configured, produces no object code output other than the assembly listing.
Modify the code so it creates an object file. If the source file is file.a, the listing file, as currently created, will be file.l. Your object file should called file.o and it should be opened similarly.
Data in your object file should be in binary, not text, and it should have thehave the following format:
Make sure that all of your code conforms to the style guidelines
http://homepage.cs.uiowa.edu/~dwjones/syssoft/style.htmlPay close attention to indenting (depending on how you downloaded your code, tab-to-space conversion may have seriously damaged the indenting), and pay close attention to the commenting rules for documenting revisions. Specifically, use comments of the form /*MP3*/ to mark any line you added, and add an appropriate revision line to the header block of any file you change.
Write an EAL program that thoroughly tests your modified code, specifically, this should demonstrate the correct generation of all of the object code items discussed above, and it should demonstrate the efficiency or inefficiency of your object code representation. (Efficiency issues arise with this code because of the possibility that you might generate unnecessary type-1 output records..
Here is a little program to read object files in this format. Use it to create human-readable listings of the object files produced by your assembler.
#include <stdio.h> main() { for (;;) { int byte1; byte1 = getchar(); if (byte1 == EOF) { puts("; normal EOF"); exit(-1); } if (byte1 == 1) { int byte2 = getchar(); int byte3 = getchar(); printf( ". = #%04X\n", (byte2 << 8) + (byte3 & 0xFF) ); if (byte2 == EOF) puts("; unexpected EOF high byte"); if (byte3 == EOF) puts("; unexpected EOF low byte"); } else if (byte1 == 2) { int byte2 = getchar(); printf( " B #%02X\n", byte2 & 0xFF ); if (byte2 == EOF) puts("; unexpected EOF"); } else if (byte1 == 3) { int byte2 = getchar(); int byte3 = getchar(); printf( " W #%04X\n", (byte2 << 8) + (byte3 & 0xFF) ); if (byte2 == EOF) puts("; unexpected EOF high byte"); if (byte3 == EOF) puts("; unexpected EOF low byte"); } else { printf("; unexpected %02X\n", byte1 ); } } }
Paper listings of every file from the EAL source code that you changed (obviously, objectcode.c will be one of these). and a paper listing of the listing file produced by EAL when it processes your test data.
In addition, show the output of the above skeleton test program when it is given the object code from your test data as input, so the original assembly code listing and the object file listing can be compared.