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 , where 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 ( ).
, , , and occupy no space
(i.e. they are empty curves).
These curves are defined as follows:
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:
- The Sierpinski curve should be drawn in a graphic mode
(preferably mode 12H).
- 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.
- You may use the BIOS interrupt 10H function 0CH to write
pixels to the screen.
- You may choose any color combination for the background and the
foreground curves as long as we can see the curves.
- 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.
- 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:
Next: About this document
Raj Sunderraman
Wed May 13 11:02:23 EDT 1998