Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Lab tools: The MARS MIPS simulator steps to use mars simulator 1) write the asse

ID: 3569953 • Letter: L

Question

Lab tools: The MARS MIPS simulator

steps to use mars simulator

1) write the assembly code in a new file

2) assemble the code from the run menu(Using assemble)

3)Run the code using the run button.

write a program to read 10 integers and to perform the following operations using menu and you may use frictions to support to your program?( use the proper prompts)

1)read the integers into an array

2) find the maximum value in array

3) find the minimum value in array

4) sum of all values

5) organize the values in the arrayfrom the smallest to largest.

Explanation / Answer

.text .globl main main: li $t0, 0 # $t0 = loop counter li $t1, 0 # $t1 = sum of even numbers loop: addi $t0, $t0, 2 # generating even numbers in register $t0 add $t1, $t1, $t0 # compute the sum bne $t0, 100, loop # if t0 reached 100 then go to loop. li $v0, 4 la $a0, result syscall # print out "Sum = " li $v0, 1 move $a0, $t1 syscall # print out actual sum exit: li $v0, 10 # terminate program run and syscall # Exit .data result: .asciiz "Sum = " #include // for cin, cout, fixed #include // for setw, setprecision #include // for srand(), rand() #include // for time() as a seed for srand() using namespace std; int main() { const int SIZE = 10; // set size of the array // print header cout