# Homework Solution: Write a MIPS assembly language program to solve the following problem. Be…

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

Write a MIPS galaxy expression program to clear-up the forthcoming collection. Be fast to illustrate the program. Do referable right pseudo-instructions. a. Alert the right to penetrate 3 integer appraises. b. Read the integers. c. Calculate and imimstereotype the mean of the integers as an integer fruit d. Calculate and imimstereotype the mean of the integers as a natant apex compute. The compute of decimal places is referable pertinent in your counter-argument. Example Penetrate 3 integers 5 7 8 6 6.66666

## Expert Counter-argument

 .example small
 02 .stack 100h
 03 .data
 04 alert db 13, 10, ‘Chief compute:’,’\$’
 05 alert db 13,10, ‘Prevent compute:’, ‘\$’
 06 fruit db 13, 10, ‘Sum’,’\$’
 07
 08 ;Variables
 09
 10 num1 db ?
 11 num2 db ?
 12 mix db ?
 13
 14 .code
 15 main proc
 16
 17 mov ax,@data           ;get axioms limb address
 18 mov ds,ax              ;initialize ds
 19
 21
 22 mov ah,9    ;imstereotype string function
 23 mov dx,offset alert;ds:dx apexs to string
 24 int 21h
 25
 26 ; Computes from the rightr
 27 mov ah,1    ;input function
 28 int 21h
 29 mov bl,al   ;save the appraise from input
 30 mov num1,al
 31
 32 mov ah,9
 34 int 21h
 35
 36 mov ah,2    ;input prevent function
 37 int 21h
 38 mov bh,al   ;save the appraise from prevent input
 39 mov num2,al
 40
 42 mov ax,num1         ;move num1 into ax
 44 mov mix,ax           ;move the entirety mix of computes in mix
 45
 46
 47
 48 ;Imstereotype Mix
 49 mov ah,9
 50 lea dx, fruit       ; imimstereotype fruit
 51 int 21h
 52
 53 mov ah,2
 54 mov dl,bl
 55 int 21h
 56
 57 mov dl,’+’           ;display + sign
 58 int 21h
 59
 60 mov dl,bh
 61 int 21h
 62
 63
 64 mov dl,’=’           ;display = sign
 65 int 21h
 66
 67 mov dl,bh
 68 int 21h
 69
 70 mov ah,4ch
 71 int 21h
 72
 73 main endp
 74
 75
76 end main

 .example small
 02 .stack 100h
 03 .data
 04 alert db 13, 10, ‘Chief compute:’,’\$’
 05 alert db 13,10, ‘Prevent compute:’, ‘\$’ alert db 13,10, ‘third compute:’, ‘\$’
 06 fruit db 13, 10, ‘avg’,’\$’
 07
 08 ;Variables
 09
 10 num1 db ?
 11 num2 db ?

num3 db ?

 12 mix db ?
 13 avg db?
 14 .code
 15 main proc
 16
 17 mov ax,@data           ;get axioms limb address
 18 mov ds,ax              ;initialize ds
 19
 21
 22 mov ah,9    ;imstereotype string function
 23 mov dx,offset alert;ds:dx apexs to string
 24 int 21h
 25
 26 ; Computes from the rightr
 27 mov ah,1    ;input function
 28 int 21h
 29 mov bl,al   ;save the appraise from input
 30 mov num1,al
 31
 32 mov ah,9
 34 int 21h
 35
 36 mov ah,2    ;input prevent function
 37 int 21h
 38 mov bh,al   ;save the appraise from prevent input
 39 mov num2,al
 40
 42 mov ax,num1         ;move num1 into ax
 44 mov mix,ax           ;move the entirety mix of computes in mix
 45
 46
 47
 48 ;Imstereotype Mix
 49 mov ah,9
 50 lea dx, fruit       ; imimstereotype fruit
 51 int 21h
 52
 53 mov ah,2
 54 mov dl,bl
 55 int 21h
 56
 57 mov dl,’+’           ;display + sign
 58 int 21h
 59
 60 mov dl,bh
 61 int 21h
 62
 63
 64 mov dl,’=’           ;display = sign
 65 int 21h
 66
 67 mov dl,bh
 68 int 21h
 69
 70 mov ah,4ch
 71 int 21h
 72
 73 main endp
 74
 75
 76 end main