Question: code in assembly Write and test a MIPS assembly language program to count each letter and digit in a text file. The program should do

code in assembly

code in assembly Write and test a MIPS assembly language program to

Write and test a MIPS assembly language program to count each letter and digit in a text file. The program should do the following: a) Open a text file "data.txt" and read all characters into an array in memory. Limit the length of the array to 10000 characters. The maximum number of characters to be read should be 10000 characters. The actual number of characters depends on the file length. MARS provides the system calls for opening and reading a text file. If the file does not exist then the program should display an error message and terminates. b) Traverse the array character by character. Count all letters, digits, words, and numbers. A word begins with a letter (AZ or az), contains letters only, and ends at a character different from a letter. A number starts with a digit, contains digits only, and ends at any character different from a digit. For example, MIPS32 has the word MIPS and the number 32, even though they are not separated by spaces. Similarly, M5 has the word M and number 5. c) Display the total count of letters, digits, words, or numbers. If file "data.txt" does not exist in the same folder then output the following error message: Error: data.txt does NOT exist. If file "data.txt" exists then output the following: Letters =126 Digits =27 Words =35 Numbers =13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!