UMBC CMSC211

Project 4 Due: 11 Dec

Requirements Specfication

Write a program that will open a file (get from the command line or ask the user for it). Read the first 2048 characters (beware, there might be less, might be more. If there is more, simply ignore it.) Close the file. Clear the screen and set the background to black. With the characters stored in an input buffer (an array!), count up on the occurrances of each letter. (If it is lowercase, convert it to upper case first.) Then graph out the results. We don't have unlimited sizes for screen, so each colum must go from 0 to 19. (If there is more than ninteen, change the foreground color!) Then for each column, output a space (decimal 32 or hex 20H) plus its color attributes.

Use the following colors to indicate the range for each column:

Foreground colorrange
001 0 - 19
010 20 - 39
011 40 - 59
100 60 - 79
101 80 - 99
110 100 - 119
111 120 - 139
If the count is higher than 139, then output the column height as a column of the "*" character.

NOTE: This is different from what was discussed in class. Then when you need to calculate the color, you divide by 20, the quotient plus one becomes the number and the remainder plus one becomes the height. This means that you must output one item for a count of zero. This algorithm makes it easier to implement!

Output the values for the X and Y axis as shown in the output example below, (Note that this shows the character "@" and not the color):

Sample Output

19
18
17
16
15
14
13
12
11
10
 9         @
 8         @
 7         @                 @
 6         @                 @   
 5 @   @   @                 @       @
 4 @   @   @                 @ @     @
 3 @   @   @       @       @ @ @     @   @
 2 @   @   @       @       @ @ @     @ @ @
 1 @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @   @ @ @ @ @ @ @ @ 
 0 @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
   A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Program Header Comment Block

Use the following comment block at the beginning of your source code:
;; Filename:       proj4.asm
;; Name:           Ima Student
;; SSAN:           6789  
;; Date:           3 Dec 2001
;; Course:         CMSC-211 
;; Description:    
;;     Analysis:   
;;       Input:
;;       Output:
;;       Formulas:
;;       Constraints:
;;       Assumpitons:
;;     Design:     (Your psuedocode goes here.  Must be detailed)
;; Notes:          (As needed, such has how to assemble.)


UMBC CMSC211 CSEE | Lectures