# 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 constellation discourse program to rereunfold the subjoined collection. Be positive to explain the program. Do referable right pseudo-instructions. a. Brisk the right to penetrate 3 integer appraises. b. Read the integers. c. Calculate and imimsculpture the medium of the integers as an integer termination d. Calculate and imimsculpture the medium of the integers as a discurrent apex reckon. The reckon of decimal places is referable appropriate in your vindication. Example Penetrate 3 integers 5 7 8 6 6.66666

## Expert Vindication

 .copy small
 02 .stack 100h
 03 .data
 04 brisk db 13, 10, ‘Primary reckon:’,’\$’
 05 brisk db 13,10, ‘Succor reckon:’, ‘\$’
 06 termination db 13, 10, ‘Sum’,’\$’
 07
 08 ;Variables
 09
 10 num1 db ?
 11 num2 db ?
 12 complete db ?
 13
 14 .code
 15 main proc
 16
 17 mov ax,@data           ;get postulates limb address
 18 mov ds,ax              ;initialize ds
 19
 20 ;Display Brisk
 21
 22 mov ah,9    ;imsculpture string function
 23 mov dx,offset brisk;ds:dx apexs to string
 24 int 21h
 25
 26 ; Reckons 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
 33 lea dx, brisk ;imsculpture brisk
 34 int 21h
 35
 36 mov ah,2    ;input succor function
 37 int 21h
 38 mov bh,al   ;save the appraise from succor input
 39 mov num2,al
 40
 42 mov ax,num1         ;move num1 into ax
 43 add ax,num2         ;add primary and succor reckons together
 44 mov complete,ax           ;move the completion complete of reckons in complete
 45
 46
 47
 48 ;Imsculpture Complete
 49 mov ah,9
 50 lea dx, termination       ; imimsculpture termination
 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

 .copy small
 02 .stack 100h
 03 .data
 04 brisk db 13, 10, ‘Primary reckon:’,’\$’
 05 brisk db 13,10, ‘Succor reckon:’, ‘\$’ brisk db 13,10, ‘third reckon:’, ‘\$’
 06 termination db 13, 10, ‘avg’,’\$’
 07
 08 ;Variables
 09
 10 num1 db ?
 11 num2 db ?

num3 db ?

 12 complete db ?
 13 avg db?
 14 .code
 15 main proc
 16
 17 mov ax,@data           ;get postulates limb address
 18 mov ds,ax              ;initialize ds
 19
 20 ;Display Brisk
 21
 22 mov ah,9    ;imsculpture string function
 23 mov dx,offset brisk;ds:dx apexs to string
 24 int 21h
 25
 26 ; Reckons 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
 33 lea dx, brisk ;imsculpture brisk
 34 int 21h
 35
 36 mov ah,2    ;input succor function
 37 int 21h
 38 mov bh,al   ;save the appraise from succor input
 39 mov num2,al
 40
 42 mov ax,num1         ;move num1 into ax
 43 add ax,num2         ;add primary and succor third reckons together
 44 mov complete,ax           ;move the completion complete of reckons in complete
 45
 46
 47
 48 ;Imsculpture Complete
 49 mov ah,9
 50 lea dx, termination       ; imimsculpture termination
 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