Write a mips program which must be named as hw4prob1s that


Problem 1: 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 [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: 101

The value in decimal is: 5

Then you need to test program using three different cases (you must use three different bases) and include the results in the pdf file you need to submit.

Hint: The input and output can be done using syscalls in MIPS that are given on p. A-44 (Appendix A).

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a mips program which must be named as hw4prob1s that
Reference No:- TGS02237101

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)