Machine Problem 4, due October 24

Part of the homework for 22C:60, Fall 2005
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Assignment:

Write code for the PLOTSTR routine that was called by SHOWITEM in machine problem 3. Your program will now consist of a main program that calls SHOWITEM, plus the subroutine itself, plus the code for PLOTSTR.

In addition, you must change your solution to machine problem 1 so that it fully tests your version of PLOTSTR. The code you turned in, and the solutions distributed in class for MP1 do not completely test PLOTSTR because only one string contains CR and LF codes, the string:

    ASCII   "A",CR,LF,"B",CR,LF,"C",NUL

The trouble with this test is that it does not demonstrate the effect of CR in isolation, nor does it demonstrate the effect of LF in isolation. You should design a test string that clearly tests these!

Recall from MP3 that calling plotstr(x,y,s) is like calling dspat(x,y) followed by dspst(s) except that the x coordinate establishes a margin for CR to return to and that LF is interpreted as moving down a line. Note that dspst(s) does nothing useful with CR and LF codes embedded in the text.

The file http://homepage.cs.uiowa.edu/~dwjones/assem/hw/mp4test.txt contains the Hawk object code for the PLOTROW routine.

Additional Requirements:

In addition to code that runs as assigned, you are responsible for producing readable code! Clean use of indenting, and appropriate comments that explain anything slightly subtle are required! Your solution must also conform to the following specific details:

  1. Your solution must be contained in a directory named mp4.
  2. Your main program be in a file in that directory named main.a.
  3. Your test data must be in a file in that directory named test.a; this test data should be a modified copy of MP1.
  4. Each file must begin with an appropriate TITLE directive identifying the file and giving your name as it appears on your ID card.
  5. Where a file contains multiple subroutines, each of them must be preceded by an appropriate SUBTITLE directive.

Use the submit command on the departmental linux cluster to submit the directory containing your solution. Your complete submit dialogue will look just like the dialogue illustrated on the handout for machine problem 1, except that your choice will be mp4 and the file you submit will be the entire directory mp4.

Your program will be assembled and the result linked to our test data as well as to yours. If the output is right when we run it with our test data, you will get half credit. The other half of the credit will be assigned based on the quality of your source file and your test data. The listing file will be printed by the TA and marked up to provide feedback on the quality of your work.