Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1 (40 points) Write a MIPS program (which must be named as hw4_probls) 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_probls") 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 [0...9, a...z]. 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 Then you need to test program using the above case and the following cases and include the results in the pdf file you need to submit. Enter a base (between 2 and 36 in decimal): 10 Enter a number in base 10: 13579 The value in decimal is: 13579 Enter a base (between 2 and 36 in decimal): 16 Enter a number in base 16: abcdef0 The value in decimal is: 180150000 Hint: The input and output can be done using syscalls in MIPS that are given on p. A-44
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