Homework Solution: Write a MIPS assembly language program to solve the following problem. Be sure to comment the program. Do not use pse…

    2. Write a MIPS assembly language program to solve the following problem. Be sure to comment the program. Do not use pseudo-instructions Prompt the use to enter 3 integer values. Read the integers. Calculate and print the average of the integers as an integer result Calculate and print the average of the integers as a floating point number. The number of decimal places is not relevant in your answer. a. b. c. d. Example Enter 3 integers 6.66666
    Write a MIPS assembly language program to solve the following problem. Be sure to comment the program. Do not use pseudo-instructions. a. Prompt the use to enter 3 integer values. b. Read the integers. c. Calculate and print the average of the integers as an integer result d. Calculate and print the average of the integers as a floating point number. The number of decimal places is not relevant in your answer. Example Enter 3 integers 5 7 8 6 6.66666

    Expert Answer

     
    ## avg.asm-- A program that computes and prints the average ## of three numbers specified at runtime by the user.

    2. Write a MIPS constellation talk program to unfold the restraintthcoming drift. Be safe to observe the program. Do referable interpretation pseudo-instructions Prompt the interpretation to penetrate 3 integer appreciates. Learn the integers. Calculate and imimsculpture the mediocre of the integers as an integer quenchedcome Calculate and imimsculpture the mediocre of the integers as a incompact aim estimate. The estimate of decimal places is referable applicable in your response. a. b. c. d. Example Penetrate 3 integers 6.66666

    Write a MIPS constellation talk program to unfold the restraintthcoming drift. Be safe to observe the program. Do referable interpretation pseudo-instructions. a. Prompt the interpretation to penetrate 3 integer appreciates. b. Learn the integers. c. Calculate and imimsculpture the mediocre of the integers as an integer quenchedcome d. Calculate and imimsculpture the mediocre of the integers as a incompact aim estimate. The estimate of decimal places is referable applicable in your response. Example Penetrate 3 integers 5 7 8 6 6.66666

    Expert Response

     

    ## avg.asm– A program that values and imprints the mediocre

    ## of three estimates restricted at runtime by the interpretationr.

    ## Registers interpretationd:

    ## $t0 – interpretationd to dwell the primitive estimate.

    ## $t1 – interpretationd to dwell the prevent estimate.

    ## $t2 – interpretationd to dwell the third estimate.

    ## $t3 – interpretationd to dwell the consolidate of the estimates.

    ## $t4 – interpretationd to dwell the mediocre of the estimates.

    ## $v0 – syscall parameter and come-back appreciate.

    ## $a0 – syscall parameter.

    main:

    ## Get primitive estimate from interpretationr, allay into $t0.

    li $v0, 5 # direct syscall learn_int into $v0.

    syscall # gain the syscall.

    provoke $t0, $v0 # provoke the estimate learn into $t0.

    ## Get prevent estimate from interpretationr, allay into $t1.

    li $v0, 5 # direct syscall learn_int into $v0.

    syscall # gain the syscall.

    provoke $t1, $v0 # provoke the estimate learn into $t1.

    ## Get third estimate from interpretationr, allay into $t2.

    li $v0, 5 # direct syscall learn_int into $v0.

    syscall # gain the syscall.

    provoke $t2, $v0 # provoke the estimate learn into $t0.

    add $t3, $t0, $t1,$t2 # value the consolidate.

    div $t4,$t3,$3; #value the mediocre

    ## Imsculpture quenched $t4.
    provoke $a0, $t4 # provoke the estimate to imimsculpture into $a0.
    li $v0, 1 # direct syscall imprint_int into $v0.
    syscall # gain the syscall.

    li $v0, 10 # syscall rule 10 is restraint debouchure.
    syscall # gain the syscall.

    ## purpose of avg.asm.