CSc 3210 Computer Organization and Programming
Fall 1999
Programming Assignment # 4
Due: November 10, 1999 (Wednesday)
Write an Assembler program to draw Hilbert Curves,
which are defined as follows:
There are four kinds of Hilbert curves which we shall name
A-curves, B-curves, C-curves and D-curves. Each of these
curves come in various sizes and are defined (recursively) as follows:
, and all occupy no space (i.e. they
are empty curves). These are curves of size zero. Curves of bigger sizes are
defined as follows:
Write the program so that it will draw
where N is a value obtained from the user.
Notes on the Implementation
- The program should be written in a graphic mode (preferably mode
12H).
- Each segment of the curve should be 16 pixels long and 4 pixels in
thickness (you may change these lengths appropriately to make the
curves look reasonable big for the human eyes to see them!).
- You should use the BIOS interrupt 10H function 0CH to write
pixels to the screen.
- You may choose (for extra credit)
to write the pixels to the display area directly
to speed up the drawing of the curves.
- You may choose any color combination for the background and
the foreground curves as long as we can see the curves.
- Begin drawing the C-curves by starting
at the lower left corner.
- It will be useful if you write procedures for drawing the various
segments (DrawNorth, DrawSouth, DrawWest, DrawEast)
and procedures for each of the four
types of curves (Acurve, Bcurve, Ccurve, Dcurve).