Question: MIPS Assembly code for arithmetics. Do it in PCSPIM only for MIPS! Objectives: write assembly language programs to -perform arithmetic and logical operations on variables

MIPS Assembly code for arithmetics. Do it in PCSPIM only for MIPS!

MIPS Assembly code for arithmetics. Do it in PCSPIM only for MIPS!

Objectives: write assembly language programs to -perform arithmetic and logical operations on

Objectives: write assembly language programs to -perform arithmetic and logical operations on variables -use syscall operations to display integers and strings on the console window -use syscall operations to read integers from the keyboard. Assignment Description: 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 num2 (num4 + numl mod 3) *2) um3) where numl 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. The following shows how it looks like in a C progranm int num1, num2, num3, num4, ansl, ans2, ans3, ans4, ans5, ans6 printf C"Enter a value: "); //read an integer from a user input and store it in numl scanf ("%d", &num1) ; printf ("Enter another value: "); //read an integer from a user input and store it in num2 scanf ("%d", &num2); printf ("Enter one more value: ") //read an integer from a user input and store it in num3 scanf ("sd", &num3) printf ("Enter one more value: ") //read an integer from a user input and store it in num4 scanf ("sd", &num4) ans! = num2 +num3 ; //addition printf( "num2+num3-%d ", ans!) ; ans2 = num3-num4; //subtract 1 n printf( "num3-num4-%d ", ans2)

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!