Machine Problem 1, due Sep. 15

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

 
A Data Structure: Consider an array (called ARRAY of records (or what C and C++ call structs, or simple objects) where each record contains three fields:

The final entry in the array should have a null pointer (zero) for the address of the string.

A Framework: Here is an example SMAL source file to construct such a data structure:

	TITLE	"mp1.a by Douglas W. Jones, Aug. 24, 2014"
; -- demonstrates the data structure for MP1

        INT     ARRAY		; make ARRAY visible to the test program

ARRAY:  W       1,1,LINE1	; array[0] -- x, y, text
        W       1,2,LINE2       ; array[2] -- x, y, text
        W       1,3,LINE3       ; array[3] -- x, y, text
        W       0,0,0           ; array[3] -- x, y, text

LINE1:  ASCII   "Hello",0
LINE2:  ASCII   "world",0
LINE3:  ASCII   "-----",0

        END

A Test Program: The object file mp1test.o contains an executable program for the HAWK computer. If you run these shell commands on the Liberal Arts Linux server cluster, presuming you have first followed the instructions in the Getting Started handout, you will assemble your data file, link it to the test program, and run the test program:

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

The output: Running the test program as above launches the Hawk emulator but does not start the emulated computer. What you see is the initial state of the CPU before it executes any code. If you hit the r key on the keyboard, the emulated computer will start executing instructions. At that point, you should see the following output on the screen below the CPU state:

Hello
world
-----

The Assignment: Modify the program so that:

<your name>
     Machine Problem 1

The above requirements should be taken seriously. We will not do detective work to determine who gets credit for what assignment. If your name is not in the title line for the source file, we will not grade your source file. This is partly a matter of professional ethics: Take credit for your work. It is also to defend an overloaded grader from having to do extra work.

Submission: Programming assignments will be submitted on-line using the on-line Online Coursework Submission tool provided by the Liberal Arts Linux server cluster. The user interface for this is awful, but but it works. Your source file must be named mp1.a (the name is case-sensitive). This is the name you will type in response to the File/directory name prompt. When the submission tool prompts for Course type c_060. Select the assignment directory mp1.

You must submit your work using the submit command from the a CLAS Linux machine. If you make repeated submissions, only the last one will count.