IUP Computer Science
COSC 300   Spring 2002
 

Project #4
(Due 1 April 2002)


You are to create a rather unusual on-screen editing environment, designed to display information reminescent of the way some left-handed people often view their own handwriting.  Your program should begin by changing the video mode so that 50 lines can be displayed, so that the screen background is white and the characters are black.  Then, clear the screen, place the cursor at column 70 of row 0 and make the cursor in the form of a solid block.

Once the screen is set up, the program should accept text input from the keyboard and display it vertically on the screen.  As the person at the keyboard types and characters are displayed, the cursor moves down the screen.  As the input text reaches the bottom of the screen, the program is responsible for wrapping the line (from row 49 of column 70, the cursor should move to row 0 of column 69).  If the Enter key is pressed, the program must move the cursor the the beginning of the next line (row 0 of next lower numbered column).  If the Backspace key is pressed, the program must move the cursor back one position and erase the character that is there, leaving the cursor where the erased character was.  Backspace must work even if the cursor is in row 0 and has to be moved to row 49 of the next higher numbered column.

When the ~ (tilde) character is entered, the program must restore the screen to normal (white on black, 25 lines displayed) and end.  The text that is entered on the screen is not to be saved anywhere.

Note:  The best way to see the display during the execution of this program is to go to MS-DOS and expand the window so that it fills the entire screen (i.e., press Alt-Enter).  In this way, the colors will match those advertised; the font will be appropriate; and the screen proportions will match those that DOS is designed to deal with.  In full-screen mode, the mouse pointer will look like a rectangle or square, rather than an arrow.  If the program is executed in a DOS window, various distortions in color and font can occur.

Hand in a printout of your well-commented program.  Also, rename the source file after yourself, as in yourname4.asm and copy this file to the handin folder for your section on the P drive, i.e., to P:\courses\spring2002\cosc\cosc300\xxx\hand-in      where xxx is your section number.
 

Extra Credit Possibilities:

  1. Allow the person at the keyboard to arbitrarily change the color of the text (keeping the background white).  Do this by having the program respond to the entry of the \ (backslash) character.  When a backslash is entered, the program should interpret the very next character as the number of the color that subsequent text should be displayed in.  For example, if the person enters \4, subsequent text should be red (color 4).   Neither the \ nor the color number should be displayed on the screen.  Color numbers 0 through 7, at least, should be recognized and acted upon.  Your program is NOT expected to be able to restore color attributes when backspacing to an area of different colored text.

  2.  
  3. Allow the person at the console to use the mouse to move the cursor to any place on the screen.  Do this by recognizing a left click of the mouse as a command to move the text cursor to the place where the mouse pointer is.  Subsequently entered text is then displayed vertically from the new cursor position.  Your program is NOT expected to be able to backspace across mouse actions.
In class, I will demonstrate an even more sophisticated version of this program.  It not only provides for color changes and mouse movement, it includes optional clearing of the screen, partial-screen horizontal scrolling, and rotation of the characters by 90o so it really does look like left-handed writing.  Do NOT attempt to do anything like this character rotation; if you do something wrong in the rotation, you can reach a point where rebooting may be necessary.  Do NOT attempt to do the horizontal scrolling; if you do something wrong in the scrolling, the screen can become totally messed up.