CSc 3210 Computer Organization and Programming

Fall 1998, Quiz 4, Due: 18 November 1998 (Wednesday)

This problem is related to Programming Assignment 4 in which an animation for a bubble sort is generated.

Write a procedure, PaintIthBar, that assumes values in the following variables to be set before it is invoked.

   color   db ?   ; a valid color value
   height  db ?   ; a value between 0 and 200
   i       db ?   ; a value between 0 and 19
The procedure will paint the portion of the screen for the Ith bar that corresponds to its height with the given color pixels. The writing of the pixels should be done directly to the video area in memory.

Hint: The address (offset from start of video area) of the top left corner of the Ith bar would be computed by the following formula:

   320 * (200 - height) + (16 * I) + 4
Once this address is computed, a loop can be set up to write the pixels to paint the Ith bar.
 
PaintIthBar proc near















PaintIthBar endp