Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

Students also viewed these Databases questions

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago

Question

=+ What topics are contained in the contracts?

Answered: 1 week ago

Question

=+Are they specific or general in nature?

Answered: 1 week ago

Question

=+ What is the nature of the contracts or agreements with unions?

Answered: 1 week ago