next up previous
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:
tex2html_wrap_inline295 , and tex2html_wrap_inline297 all occupy no space (i.e. they are empty curves). These are curves of size zero. Curves of bigger sizes are defined as follows:

picture16

Write the program so that it will draw tex2html_wrap_inline339 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

  1. The program should be written in a graphic mode (preferably mode 12H).
  2. 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!).
  3. You should 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 C-curves by starting at the lower left corner.
  6. 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).

picture66





Raj Sunderraman
Sat Nov 8 10:11:29 PST 1997