152k views
5 votes
Write a complete program in Assembly Language: 1. Promts the user to enter 10 numbers. 2. saves those numbers in a 32 bit integer array. 3. Calculates the sum of the numbers and displays it. 4. Calcualtes the mean of the array and displays it. 5. Prints the array with the same order it was enterd. 6. Rotates the members in the array forward one position for 9 times. so the last rotation will display the array in reversed order. Print the array after each rotation. check the sample run. Here is Sample Run: Please enter a number: 2 Please enter a number: 3 Please enter a number: 4 Please enter a number: 5 Please enter a number: 6 Please enter a number: 7 Please enter a number: 8 Please enter a number: 9 Please enter a number: 0 Please enter a number: 10 The sum is: 54 The mean is: 5 4/10 The original array: 2 3 4 5 6 7 8 9 0 10 After a rotation: 10 2 3 4 5 6 7 8 9 0 After a rotation: 10 0 2 3 4 5 6 7 8 9 After a rotation: 10 0 9 2 3 4 5 6 7 8 After a rotation: 10 0 9 8 2 3 4 5 6 7 After a rotation: 10 0 9 8 7 2 3 4 5 6 After a rotation: 10 0 9 8 7 6 2 3 4 5 After a rotation: 10 0 9 8 7 6 5 2 3 4 After a rotation: 10 0 9 8 7 6 5 4 2 3 After a rotation: 10 0 9 8 7 6 5 4 3 2 Press any key to continue . . .

2 Answers

5 votes

Answer:

.model small

.stack 100h

.data

prompt db 13, 10, 'First number:','$'

prompt db 13,10, 'Second number:', '$'

result db 13, 10, 'Sum','$'

Step-by-step explanation:

See attach image

Write a complete program in Assembly Language: 1. Promts the user to enter 10 numbers-example-1
User Rayzinnz
by
6.6k points
3 votes

Answer: provided in the explanation section

Step-by-step explanation:

i hope this helps.

DATA SEGMENT

ARRAY DB 1,4,2,3,8,6,7,5,9

AVG DB ?

MSG DB "AVERAGE = $"

ENDS

CODE SEGMENT

ASSUME DS:DATA CS:CODE

START:

MOV AX,DATA

MOV DS,AX

LEA SI,ARRAY

LEA DX,MSG

MOV AH,9

INT 21H

MOV AX,00

MOV BL,9

MOV CX,9

LOOP1:

ADD AL,ARRAY[SI]

INC SI

LOOP LOOP1

DIV BL

ADD AL,30H

MOV DL,AL

MOV AH,2

INT 21H

MOV AH,4CH

INT 21H

ENDS

END START

cheers i hope this helps!!!

User PeterJ
by
7.3k points