Write an assembly language program to demonstrate your understanding of terminal escape sequences. The program will cause the terminal to behave more or less like Etch-a-Sketch with keyboard control.
Your program should begin by clearing the screen and positioning the cursor in the middle of the screen (row 13, column 40). The program should then read one character at a time (with no prompt, not even a ?) and respond to each input character. Characters that are digits (from the numeric keypad) and the ~ (tilde) are control characters. All other characters require no action. The control characters are to be interpreted as follows.
Char Your program's action ~ Clear the screen, make sure the display mode is normal, and terminate the program. 0 Clear the screen; leave the cursor where it is. 1 Change to reverse video for display. 2 Display subsequent characters vertically downward; i.e., after each subsequent non-control character move the cursor left and down one. 3 Change to flashing (blinking) mode for display. 4 Display subsequent characters horizontally to the left; i.e., after each subsequent non-control character move the cursor left two. 5 Move the cursor to the center of the screen, position (13,40). 6 Display subsequent characters horizontally to the right; opposite of 4. This produces "normal" character positioning. 7 Change to normal mode for display. 8 Display subsequent characters vertically upward; opposite of 2. 9 Change to bold mode for display.The control characters are not chosen randomly. If you look at the numeric keypad, you will see that the 8, 6, 4, and 2 keys each have an arrow pointing in the direction indicated above.
With this type of control, it should be possible for someone using your program to produce a display such as the following, as well as many others that are more elaborate. The example is constrained by what can be put on paper; i.e., no flashing or reverse video. Your program must give full flexibility in choosing display form and direction.
Now is the time for 9all7 good 2 6party. p e 7 o e p h l t e 9 8 fo dia eht ot emoc ot4Of course, such a display would be even more impressive if the control characters did not appear; then, the program would be even more like Etch-a-Sketch. But, that is not a requirement of the assignment. If you wish to try to make the program work without displaying the control characters, it will be worth extra credit. It is not difficult to get the extra credit; however, it does require a slightly different display philosophy. Without the control characters, a display such as the following is possible.
Now is the time for all good p e party. o p e l h e t fo dia eht ot emoc otHand in a printout of the listing (.LIS) file for the program. You must also hand in the executable file by writing it to the HANDIN directory (HANDIN:). Name the file after yourself (your last name) - for example, I would call my file WOLFE.EXE. If you choose to do the extra credit, name the executable file after yourself but begin with "X" - for example, I would call my file XWOLFE.EXE if I were doing the extra credit.