Question: Write a MIPS assembly program that asks the user for file name (max 50 chars). Open the file for reading. Next, read the file contents
Write a MIPS assembly program that asks the user for file name (max 50 chars). Open the file for reading. Next, read the file contents as characters (max 100 chars). After that, loop over each character, if the character is a digit (i.e. ' 0 ' to ' 9 '), convert it to integer, and store it in another array called "array_int". Assume the maximum number of integers in the file is 20. Finally, print "array_int" in reverse order. Sample numbers.txt file \begin{tabular}{|c|} \hline 123456 \\ 79 hello, world \\ 851 \\ \hline \end{tabular} Static Data segment \begin{tabular}{|c|} \hline .data \\ filename: .space 50 \\ filecontents: .space 100 \\ array_int: .word 0:20 \\ \hline \hline \end{tabular} Sample Run: Enter filename: numbers.txt Integer array reversed: Your number is a positive even number I need the output to be exactly this way
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
