Question
Problem 1 (40 points) Write a MIPS program (which must be named as hw4_prob1.s) that will read in a base (as an integer) and a
Problem 1 (40 points) Write a MIPS program (which must be named as hw4_prob1.s) that will read in a base (as an integer) and a value (nonnegative integer but as an ASCII string) in that base and print out the decimal value; you must implement a function (which accepts a base and an address for a string as parameters, and returns the value) and call the function from the main program. The base will be given in decimal and will be between 2 and 36, and the digits for the values will be in set [09, az]. You can assume that no overflow will occur and the value is valid in the given base. An example run will be:
Enter a base (between 2 and 36 in decimal): 2
Enter a number in base 2: 110
The value in decimal is: 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started