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:
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 a value obtained from the user.
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 (for extra credit) to write the pixels to the display area directly to speed up the drawing of the curves.
  5. You may choose any color combination for the background and the foreground curves as long as we can see the curves.
  6. Begin drawing the C-curves by starting at the lower left corner.
  7. 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