Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

: given an array of doubleword integers, (1) find their i and (2) add 10 to each number smaller than average ; author: R. Detmer

image text in transcribed
image text in transcribed
: given an array of doubleword integers, (1) find their i and (2) add 10 to each number smaller than average ; author: R. Detmer : revised: 6/2013 ave 586 MODEL FLAT .STACK 4096 . DATA nbrArray DWORD 25, 47, 15, 50, 32, 95 DUP (?) nbrElts DWORD 5 CODE main : find sum and average PROC sumO eax, 0 ebx, nbrArray mov get address of nbrArray ; count : nbrElts i quit if no numbers ; add number to sum : get address of next array elt : repeat nbrElts times mov ecx, nbrElts jecxz qui forCountl: add eax, [ebx] add ebx,4 loop forCount1 cdq idiv nbrElts ; extend sum to quadword : calculate average : add 10 to each array element below average lea ebx, nbrArray mov ecx,nbrElts jnl endIfSmall add DWORD PTR [ebx], 10 ; get address of nbrArray ; count := nbrElts : number average ? : continue if not less forcount2: ebx], eax add 10 to number endIfSmall add ebx,4 loop forcount2 i get address of next array elt i repeat ; exit with return code o mov eax, 0 ret ENDP quit: main END Figure 5.9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

8-16 Describe some of the weaknesses exploited by malware.

Answered: 1 week ago

Question

Why is the idf of a term always finite? Give a brief explaination

Answered: 1 week ago