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
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