Machine Problem 5, due Apr 28

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

Assignment:

A popular screensaver from the past used to plot an animated "worm" on the the screen. If you constrain yourself to the ASCII display of the Hawk, this such a worm might look like the following:

        * * *
            *   *
            *   *
            * * *

You should recognize this assignment. The worm is the exact same worm that was assigned for MP4. The behavior of the worm should be exactly the same, including all elements of worm length, randomness and worm termination.

The difference in this assignment is that the worm implementation may not use the Hawk monitor to draw on the screen. Specifically, use of PUTAT and PUTCHAR are forbidden. As a result, you will need to write your own code to directly access the Hawk's video RAM in order to plot your worm on the screen.

Since you have direct access to the video RAM, the collision detection logic in the worm can be greatly simplified. In the old worm, detecting collisions with itself required making 10 sets of coordinate comparisons -- with every cell in the worm. Now, with direct access to the video RAM, you can simply inspect a cell of the video RAM to see if it contains a blank or an asterisk.

Requirements:

Grading

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

Notes

If you ask for help debugging your code, your code must be well commented. We will not look at "naked" assembly code with no comments to suggest what it is intended to do, and when we find poor comments or discrepancies between the comments and the code, we may ask you to fix those before we look at the code in any detail. Of course, if you ask for help with the comments themselves, we will be glad to offer suggestions.