ECE 33: Introduction to Computer Engineering
Programming Assignment II
DUE: NOVEMBER 6, 1995

This assignment is supposed to teach you the use of memory to store data and intermediate results. Write a program in 8085 assembly language that would selectively capitalize a given letter in an input sentence.

The program should first print out a welcoming message. It should then ask for a sentence to be typed in. User can type in any sentence of up to 60 character long (You need not check this length. You may assume that user can follow at least some basic instructions). The sentence input ends when the user types in either a Carriage Return or a period (.).

The program then should prompt the user to type in a letter. If the input is anything but a letter (small or capital), the program should beep, wipe out the wrong character and wait for a valid input.

As soon as a valid input is entered, the program should produce its output (on the next line) which should be identical to the user input except that the specified letter should be capitalized.

The program should then prompt for another sentence and another character to capitalize.

The program should end with a good bye message when the user types in a Carriage Return when prompted to type in a sentence.

A typical session may look like this:

The First Capital Bank
``We don't put a cap on your capital''
Do you need to expand your business?
Just give us a letter and we will give you the capital needed!
(Hit Carriage Return to leave the Bank)

What do you say? _

Note how the cursor is waiting for the user input. The user types in a sentence. As soon as a period is typed in, the program prompts for the input of a letter. The screen now becomes:

The First Capital Bank
``We don't put a cap on your capital''
Do you need to expand your business?
Just give us a letter and we will give you the capital needed!
(Hit Carriage Return to leave the Bank)

What do you say? I do not believe it.

OK, now give us a letter: _

The user types in a few digits and a comma, but each time the computer beeps at him and the screen does not change. Finally the egotist user types in letter ``i'' to see the screen changed to

The First Capital Bank
``We don't put a cap on your capital''
Do you need to expand your business?
Just give us a letter and we will give you the capital needed!
(Hit Carriage Return to leave the Bank)

What do you say? I do not believe it.

OK, now give us a letter: i

Here is your capital: I do not belIeve It.

What do you say? _

Note that had the user typed in capital I for the letter, the program response would have been exactly the same. The program is now expecting another sentence. The user types in his request followed by a Carriage Return. The screen becomes:

The First Capital Bank
``We don't put a cap on your capital''
Do you need to expand your business?
Just give us a letter and we will give you the capital needed!
(Hit Carriage Return to leave the Bank)

What do you say? I do not believe it.

OK, now give us a letter: i

Here is your capital: I do not belIeve It.

What do you say? Can I get a small Amount of $50,000?

OK, now give us a letter: _

This time user types in 'A' to see the scree become:

The First Capital Bank
``We don't put a cap on your capital''
Do you need to expand your business?
Just give us a letter and we will give you the capital needed!
(Hit Carriage Return to leave the Bank)

What do you say? I do not believe it.

OK, now give us a letter: i

Here is your capital: I do not belIeve It.

What do you say? Can I get a small Amount of $50,000?

OK, now give us a letter: A

Here is your capital: CAn I get A small Amount of $50,000?

What do you say? _

Knowing that the bank is only playing with him by repeating everything that he says, the user types in a Carriage Return to see the final goodbye from The First Capital Bank:

The First Capital Bank
``We don't put a cap on your capital''
Do you need to expand your business?
Just give us a letter and we will give you the capital needed!
(Hit Carriage Return to leave the Bank)

What do you say? I do not believe it.

OK, now give us a letter: i

Here is your capital: I do not belIeve It.

What do you say? Can I get a small Amount of $50,000?

OK, now give us a letter: A

Here is your capital: CAn I get A small Amount of $50,000?

What do you say?

Thank you for visiting The First Capital Bank.
We hope you have learnt to build your own capital
rather than relying on others.

Name the program prog2. Submit files prog2.asm and prog2.hex (produced by a80) on a diskette. Also submit prog2.asm in printed form. Your program should clearly identify you (and your section) in the program header.

The programs will be graded for efficiency (compactness of the code and speed of execution), correct programming style, proper labels, good comments and pleasing interaction with the user (user interface). Please use your own imagination while designing the screen layout and messages. See the three example programs (example1.asm - example3.asm) to learn the correct programming style.