IUP Computer Science
COSC 300 Fall 2000

Assignment #4
(Due 1 November 2000)

Using the INT 10h and INT 21h functions, write an assembly language program that accepts specifications of screen positions, sizes, and colors and draws colored squares (boxes) on the screen. Specifically, the program must

  1. Prompt for a row number (value 0-49), a column number (value 0-79), a box size (number of characters on one side), and a color (value 0-15). All prompts must be in the upper left corner of the screen, on the first line. Residual elements from previous prompts or entries must not be present as each prompt is displayed. Note: that the range of row numbers requires setting an appropriate default ROM font.

  2. Move the cursor so that a square can be displayed that is approximately centered on the specified row and column position.

  3. Draw a box of the specified size and color. Your program must validate the color value (make sure it is between 0 and 15).

  4. Do it all again. Repeat the first three actions until the row number entered is a negative number - at that point end the program.
Note: In order to display a box, you just output characters that are solid squares to fill the appropriate row/column positions. To get the right visual perspective, you may want to select an 8x8 font from the font menu on the MS-DOS window.

The purpose of this assignment is to give you experience using the MS-DOS and BIOS function calls. Consequently, you will NOT be allowed to use many of the procedures in Irvine's library. Any procedure that manipulates the cursor or display attributes from the library is NOT allowed. The only procedures from the library that may be used in this program are the ones to read in an integer value and to display a string of ordinary characters (without video attributes).

Hand in a well-commented assembler-generated listing of your program. Also, hand in a disk that contains both the source (.ASM) file and the executable (.EXE) file.

EXTRA CREDIT:

For extra credit, your program should validate the row, column, and box size information to insure that the box will fit on the screen.