Machine Organization I
V22.0201 - Fall 2003

Assignment 3

Due: The Day of the Midterm
Dewar's Section: Monday, Oct. 27th - Hull's Section: Thursday, Oct. 23rd

Simple Bubble or Exchange Sort

In this program, you are to input a series of characters until you reach an exclamation mark ("!"). You will then print on the screen the count of each letter which has occurred, sorted in descending order by occurrence. The maximum count will be 255.

Thus, if your input is:

Wow, I just Loooooooooooooooove Assembler!

Your output would be:

The Letter Count of Your Message is:

O  17
E   3
S   3
L   2
W   2
A   1
B   1
I   1
J   1
M   1
R   1
T   1
U   1

V   1

Notes: One solution is to keep an array which has both the letters and the counts in it, such as this:

  ... etc.

Then, when you sort the array by the count, keep the letter and the count together, like this:

  ... etc.


Use INT 16H (which we demonstrated in class) for input. Echo print your input character by character.

The code for converting the count into decimal ascii is exactly that found in Chapter 2, with the exception that leading zeroes should be converted into spaces.

Email your E-Tutor the ASM file.