IUP Computer Science
COSC 300

Project #6
(Spiral Display)
(Due  29 Apr 08)

Write a 16-bit assembly language program that does the following tasks:

  1. Prompts for the entry of up to 200 characters of text.  The text is to be entered continuously with Enter pressed only after the last character.  Note:  if ReadString is used to read in this text, be advised that cx must hold the maximum number of characters -1, dx must hold the offset of the buffer and ax will contain the number of characters entered, including an attached null, after the call.  Also note, the 16-bit ReadString from Irvine's library cannot erase characters; backspace characters will be part of the string if you try to erase.
  2. Clear the screen to a cyan background so that text will appear in yellow and make the cursor disappear.
  3. Allow the mouse to be used select a point to be used as the center of the spiral.  The mouse pointer should move with the movement of the mouse; when the left button is clicked, the position of the mouse pointer is to become the center of the spiral.
  4. Display the text that was entered in a clockwise spiral starting at the point selected with the mouse.
  5. After displaying the spiral, move the cursor to the bottom left corner of the screen and make it reappear.
To make characters display in a clockwise spiral, display in the sequence right - down - left - up repeatedly increasing the length of what is being displayed after each two changes in direction.  Thus, you would display 1 character moving right and down, then 2 characters moving left and up, then 3 characters moving right and down, then 4 characters moving left and up, and so on.  I highly recommend the use of procedures accessing global data to do this.  I also recommend separately moving the cursor and displaying the characters.

For example, if the following text is entered:
Here is a sample of the text that you might use for the spiral.

The display would look like this:

      t use fo
      hthe ter
      g s a x
      ifiHestt
      mo era h
        elpmte
      uoy tah
       .larips

Hand in a printout of your source program, the .asm file.   Also, after renaming the file containing the source to  yourname6.asm and the executable to yourname6.exe, copy the source program and the executable file to the hand-in folder for  COSC300 on the P drive.