Machine Problem 6, due December 6

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

Submit the source file mp6.a for your solution using the submit command, documented at:
-- http://www.divms.uiowa.edu/help/msstart/submit.html

The Problem

The file mp6data.o defines the external symbol DATA, but unlike mp4data.o and mp5data.o, DATA is a pointer to an array of pointers to strings. The last pointer in this array is null. The following illustrates how DATA could be defined in mp6data.a to give just three strings:

        INT     DATA
DATA:   W       S1
        W       S2
        W       S3
        W       0
S1:     ASCII   "zddrr*",0
S2:     ASCII   "c2yc3x*",0
S3:     ASCII   "c1yc1x+yx+x*",0
Each of these character strings is in the same form used in machine problems 4 and 5. Your program should read and interpret all of the strings. Each string is independent of the others, but the output from interpreting all of these strings should be overlayed on the screen.

Note: Many of the strings will contain errors such as plotting characters off the edge of the screen or containing unbalanced parentheses. Whenever such an error is encountered, your code should abandon the string it is working on and move on to the next string.

Note also that you should modify your handling of square brackets so that square brackets can be nested. That is, when skipping forward to a closing square bracket or when skipping backward to an opening bracket, you should skip to the matching bracket and not just to the first one you find. Unbalanced brackets are therefore as big a problem as unbalanced parentheses. In this context, you can safely assume that there is a null before and after each string.

Grading Critereia