This MIPS assembly program compresses a string of alphabets (maximum 39) in such a way that if an alphabet occurs more than once consecutively, it replaces all the subsequent occurings with the number of occurence and prints / displays out the new compressed string. Also, the program checks if the input string is valid (i.e. contains only alphabets) and prompts error if found otherwise. The program has been executed and tested in the MARS Simulator.
Enter an input string with less than 40 characters and only containing a-z or A-Z: AAAAAAAAAAAAAAAbbaacfeeexxxi
Compressed string: A15b2a2cfe3x3i