UMBC CMSC211

12 Mar
GetDec only returns signed values, so when working with the word array, you MUST insure the user does not attempt to enter in an unsigned value greater than 32767! GetDec also sets the CY flag if the user has entered an invalid signed number, so use it for error checking!!!!


Project 2 Due: 15 March

Requirements Specfication

Write a program that:
  1. Ask the user for ten integer values (8 bit, use DB for the array. Display the average.
  2. Ask the user for ten integer values (16 bit, use DW for the array. Display the average.
  3. Ask the user for a line of input, using _GetStr (remember to declare the necessary structure!) Print the string out backwards. You must assume a maximum size for the string, but when you print the reversed input, only output the number of characters that was input!

Document when you are assuming the integers to be signed or unsigned, so that grader will not penalize you in the event the grader has a different assumption!

For the 8 bit array, when you get the input, the value entered could be too large (or small) to fit into 8 bits, so you must reject invalid values. Require the user to give you a different

Name the source code file: proj2.asm

Submission

Email the source file (the .asm file) to the grader at rrizza1@gl.umbc.edu.

Example Output

In the following example (I assumed unsigned values), the program displays what is in Blue and the user types what is in Red.

Enter ten values in the range of 0 to 255:
1
2
3
-4
Invalid value 4
5
6
7
8
9
10

The average is 5
Enter ten values in the range of 0 to 65535:
1
2
3
4
5
6
7
8
9
10

The average is 5

Program Header Comment Block

Use the following comment block at the beginning of your source code:
;; Filename:       proj1.asm
;; Name:           Ima Student
;; SSAN:           6789  
;; Date:           3 Feb 2001
;; Course:         CMSC-211 
;; Description:    (Your psuedocode goes here.  Must be detailed)
;; Notes:          (As needed, such has how to compile)


UMBC CMSC211 CSEE | CMSC211 | Lectures