Question: The read_int system call (number 5) will cause the running program to stop and wait for the user to type in an integer at the

The read_int system call (number 5) will cause the running program to stop and wait for the user to type in an integer at the keyboard. The integer will be put into $v0 register and will be available after the syscall completes. Write a MIPS assembly language program which prompts for a user to enter four integers and calls read_int four times to read in four integers. The program should perform addition, subtraction, multiplication, integer division, and modulo operation (compute the remainder of their division) using two of these four integers (see the C program below), then display their result on the console window. Also compute (num3 % num4)+((num2 - 21 * num1) / 5) where num1 is the first read integer, num2 is the second read integer, num3 is the third read integer, and num4 is the forth read integer, and display the result. Name your source code file assignment3.s.

Here is a sample output (user input is in bold):

Enter a value: 8 Enter another value: 5 Enter one more value: 11 Enter one more value: -3 num3+num4=8 num4-num1=-11 num3*num1=88 num1/num2=1 num3 mod num1=3 (num3 mod num4)+((num2 - 21 * num1) / 5)=-30

Forgot to mention I only need the last one (num3 mod num4)+((num2 - 21 * num1) / 5)=-30

I have been able to figure out the rest

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!