Next: About this document
CSc 343 Computer Organization and Programming
Fall 1997
Programming Assignment # 5 (For extra credit (worth upto 10%))
Due: December 3, 1997 (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 defined in the data segment. The program
should work for different values of N just by changing
the value of N.
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 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).
Raj Sunderraman
Sat Nov 8 10:11:29 PST 1997