Machine Problem 4, due Oct. 27

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

An assignment: Write a subroutine that fleshes out the following:

        INT     FILL
FILL:   ; expects R3 = p -- the address of a two-dimensional character array
        ;         R4 = c -- the number of columns in the array
        ;         R5 = r -- the number of rows in the array
This subroutine will be called by a main program provided in mp4test.o that you can link to. You may, of course, write your own test program.

Your subroutine should fill the array with the largest Sierpinski triangle that will fit within the bounds of the array, centered in the array, using essentially the algorithm from MP3. You may base your work on any solution to MP3, but you must identify the solution you started with in the comments in your code. Using someone else's code without giving credit is dishonest, and if you base your solution on your own code, give yourself credit.

Your subroutine will almost certainly need to call other subroutines (for example, a recursive triangle plotting routine derived from the code for MP3). Your subroutine must not in any way alter any array elements that are not part of the triangle.

You may need to use global variables to communicate between the subroutines of your solution.

An two dimensional array of c columns and r rows is stored as a sequence of r one dimensional arrays of c characters, each representing one row of the array. So, consecutive characters in a row are stored consecutively, while consecutive characters in a column are not consecutive, but rather, are stored stored at addresses that differ by c.

Requirements: Your program must:

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: As with MP1, use the on-line Online Coursework Submission tool provided by the Liberal Arts Linux server cluster. Your source file must be named mp3.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 mp4.