next up previous
Next: About this document

CSc 343 Computer Organization and Programming
Spring 1998
Programming Assignment # 3
Due: May 25, 1998 (Monday)

Write an assembler program to draw Sierpinski Curves, which come in different sizes. We shall denote Sierpinski curves by tex2html_wrap_inline347 , where tex2html_wrap_inline349 is the size of the curve. Sierpinski curves are defined in terms of four other types of curves which we shall name A-curves, B-curves, C-curves and D-curves. Each of these curves also come in various sizes ( tex2html_wrap_inline349 ). tex2html_wrap_inline353 , tex2html_wrap_inline355 , tex2html_wrap_inline357 , and tex2html_wrap_inline359 occupy no space (i.e. they are empty curves). These curves are defined as follows:

picture16

Write an assembly program that requests the user for the size of the Sierpinski curve to draw (i < 10) and then draws the curve on the display in graphics mode. The program should start in text mode, in which it requests the size, and then switch to graphics mode to draw the curve.

Notes on implementation:

  1. The Sierpinski curve should be drawn in a graphic mode (preferably mode 12H).
  2. Each horizontal or vertical segment of the curve should be 16 pixels long and 1 pixel in thickness and other segments should be 8 pixels long and 1 pixel in thickness.
  3. You may use the BIOS interrupt 10H function 0CH to write pixels to the screen.
  4. You may choose any color combination for the background and the foreground curves as long as we can see the curves.
  5. Begin drawing the Sierpinski curves by starting to draw its A-curve somewhere in the top left corner of the display. Make sure to leave some space to the left and top of the starting point so that the curve does not go outside the display area.
  6. It will be useful if you write procedures for drawing the various segments (DrawNorth, DrawSouth, DrawWest, DrawEast, DrawNorthEast, DrawNorthWest, DrawSouthEast, DrawSouthwest) and procedures for each of the five types of curves (Scurve, Acurve, Bcurve, Ccurve, Dcurve).

Sample Sierpinski curves are shown below:

picture64

picture69

picture78

picture103




next up previous
Next: About this document

Raj Sunderraman
Wed May 13 11:02:23 EDT 1998