Question: In MIPS language, Please make sure it is working corectly. Will vote! You ( probably ) used syscalls 3 5 and 3 4 in the

In MIPS language, Please make sure it is working corectly. Will vote!
You (probably) used syscalls 35 and 34 in the last lab. Libraries and operating systems
have many functions like these (or syscall 1, or 5, etc). Someone had to write it. Today you are that someone. The old someone was up too late and our multiply instruction broke. Write a replacement, and make sure its not slow.
Prgm1) Prompt the user to enter 2 base-10 numbers and save them to data memory.
Then using add/shift method, multiply the two numbers together. You CANT use mul
directly. Output the result using syscall 1 to the screen. There is no credit if your code
will do more than 32 iterations for some input (i.e. no slow, n*m =
n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+n+...).
Prgm2) Print the answer from Prgm1 in base-32. Stick to using only the t-registers when you can. (If you use an integer to ASCII character mapping that we learned in the previous lecture, you will be able to easily implement this function.)
Notes:
By base-32 I mean like hex (base-16) but with groups of 5 bits instead of 4 from Least
Significant Bit (LSB), so we use letters up to V. Start by thinking about how you would do
syscall 1,35, or 34.
For example, 01011101000101010100010000111100(in 32 bit)
(Grouping 5 bits from LSB)01011101000101010100010000111100
(Conversion into base-32)1 E H A H 1 S

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!