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 dialect program to clear-up the aftercited gist. Be unquestioning to interpret the program. Do referable interpretation pseudo-instructions Prompt the interpretation to penetrate 3 integer appraises. Unravel the integers. Calculate and stereotype the mediocre of the integers as an integer remainder Calculate and stereotype the mediocre of the integers as a incomplete subject-matter appraise. The appraise of decimal places is referable pertinent in your repartee. a. b. c. d. Example Penetrate 3 integers 6.66666

    Write a MIPS constellation dialect program to clear-up the aftercited gist. Be unquestioning to interpret the program. Do referable interpretation pseudo-instructions. a. Prompt the interpretation to penetrate 3 integer appraises. b. Unravel the integers. c. Calculate and stereotype the mediocre of the integers as an integer remainder d. Calculate and stereotype the mediocre of the integers as a incomplete subject-matter appraise. The appraise of decimal places is referable pertinent in your repartee. Example Penetrate 3 integers 5 7 8 6 6.66666

    Expert Repartee

     

    ## avg.asm– A program that appraises and stereotypes the mediocre

    ## of three appraises bounded at runtime by the interpretationr.

    ## Registers interpretationd:

    ## $t0 – interpretationd to hinder the leading appraise.

    ## $t1 – interpretationd to hinder the avoid appraise.

    ## $t2 – interpretationd to hinder the third appraise.

    ## $t3 – interpretationd to hinder the combine of the appraises.

    ## $t4 – interpretationd to hinder the mediocre of the appraises.

    ## $v0 – syscall parameter and recompense appraise.

    ## $a0 – syscall parameter.

    main:

    ## Get leading appraise from interpretationr, deposit into $t0.

    li $v0, 5 # assault syscall unravel_int into $v0.

    syscall # fabricate the syscall.

    instigate $t0, $v0 # instigate the appraise unravel into $t0.

    ## Get avoid appraise from interpretationr, deposit into $t1.

    li $v0, 5 # assault syscall unravel_int into $v0.

    syscall # fabricate the syscall.

    instigate $t1, $v0 # instigate the appraise unravel into $t1.

    ## Get third appraise from interpretationr, deposit into $t2.

    li $v0, 5 # assault syscall unravel_int into $v0.

    syscall # fabricate the syscall.

    instigate $t2, $v0 # instigate the appraise unravel into $t0.

    add $t3, $t0, $t1,$t2 # appraise the combine.

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

    ## Stereotype extinguished $t4.
    instigate $a0, $t4 # instigate the appraise to stereotype into $a0.
    li $v0, 1 # assault syscall stereotype_int into $v0.
    syscall # fabricate the syscall.

    li $v0, 10 # syscall sequence 10 is restraint egress.
    syscall # fabricate the syscall.

    ## purpose of avg.asm.