Machine Problem 1, due Feb 24

Part of the homework for 22C:60 (CS:2630), Spring 2014
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Assignment:

Build a data structure in the file mp1.a in your home directory that puts out your name on the screen using the following basic rules:

If you turn in the above code, unchanged, you will receive no credit because the title is unchanged and it outputs the wrong string in the wrong place on the screen. Furthermore, the list contains only one element when your list ought to contain three elements.

By way of explanationm, the INT directive tells the assembler to tell the linker about the symbol HEAD so that the linker can tell the main program where the list is.

Test Your Code:

The object file of a main program will be provided called mp1test.o so that you can test your data structure. Specifically, you can assemble and link your data structure to this main program and then run the program using the following sequence of Unix/Linux shell instructions:

smal mp1.a
link mp1.o mp1test.o
hawk link.o

Turn In Your Solution

You should use the submit command on the departmental Linux cluster to submit your work. See the help page at

-- http://www.divms.uiowa.edu/help/msstart/submit.html

for help on using the coursework submission tools or just follow the very long winded instructions output by the submit shell command.

In short, submit the file mp1.a from your home directory into the submit repository for course c_060 in the submit directory mp1. Sounds easy, but the submit command is remarkably verbose. Here is an abridged transcript of a successful submission:

[HAWKID@serv16 hw]$ submit

1) You must supply at least one file/directory name or ...
2) You must be in the directory that contains the homework ...
3) Case does matter.
4) Submitting the same homework assignment multiple times will ...
5) Enter only one assignment per line, when finished press
[ENTER] on a line by itself 

 File/directory name:  mp1.a
 File/directory name:  

Course (22C:016 would be c_016): c_060
Possible submit directories for /group/submit/c_060 are:

mp1

Choice:   mp1
mp1.a
* File/directory mp1.a has been 
*  copied to /group/submit/c_060/mp1/mp1.a.HAWKID.
[HAWKID@serv16 hw]$

Grading

As mentioned above, the assignment number mp1 and your name must appear on the title of the listing. In addition, the file name of the file you submit must be mp1.a. No upper case, no alternatives.

Notes

A student asked, what does the test program do? In answer to that questionm here is the test program, expressed using the syntax of the C language. It would look very similar (and it would be about the same size) in languages like Java and Python. If you know those languages, it should not be too hard to read this example:

/* description of the structure of a list element */
struct record {
        struct record * next;
        int x;
        int y;
        char * s;
};

/* linkage to the student's definiton of head, the first list element */
extern struct record head;

/* the main program */
int main() {
        struct record * p = &head;
        while (p != NULL) {
                putat( p->x, p->y );
                puts( p->s );
                p = p->next;
        }
}