Question: Assembly Language 1:40 1 For this program you in an array will find the a verage of 5 numbers stored ALL numbers will be stored

Assembly Language
 Assembly Language 1:40 1 For this program you in an array

1:40 1 For this program you in an array will find the a verage of 5 numbers stored ALL numbers will be stored as DWORDs except the size of the array, called numElems which is stored as a WORD and initialized to be the constant S The code section of your program must not contain any constants The program will involve two loops. Inside the first loop you will prompt the user for five numbers, each of which is 50 or less. The user must press each number is input. Store each number in the DWORD array, and accumulate the sum of the numbers in a DWORD data item called theSum. You must use indirect addressing using square brackets to access the contents of the array, either to read it or write it. ENTER after The second loop will write out the contents of the array to the terminal. Again, square brackets must be used to access the array elements. Finally, you will calculate and display the average of the numbers input. This requires a division using the idiv (integer divide) instruction. You will use this instruction to produce a 16 bit result in ax. Used this most significant part of the dividend in dx. In this case dx is set to 0. The least significant part of the dividend is in ax In your program, this instruction will look as follows: idiv numElems. way the idiv instuction requires the Note that since the result you accumulated in theSum the first loop is a 32 bit quantity, you will need to use PTR to get the least significant part of this quantity into ax in preparation to do the divide. The output of the program looks as follows Input an integer less than 50 and press ENTER: 24 Input an integer less than 50 and press ENTER: 30 Input an integer less than 50 and press ENTER: 46 Input an integer less than 50 and Input an integer less than 50 and press ENTER: 18 The 5 numbers input are: 24 30 46 32 18 The average of the five numbers input is: 30 press ENTER: 32

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!