1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jenyasd209 [6]
3 years ago
11

Write an assembly language program with a loop and indexed addressing that calculates the sum of all the gaps between successive

array elements. The array elements are DWORDs, sequenced in non-decreasing order. For example, the array [0, 2, 5, 9, 10] has gaps 2, 3, 4, and 1, whose sum equals 10.
Computers and Technology
1 answer:
PSYCHO15rus [73]3 years ago
7 0

Answer:

Description: Write a MASM 32bit program with a loop and indexed addressing that calculates the sum of all thegaps between successive array elements. The array elements are doublewords, sequenced in nondecreasing order.

;Include Irvine32.inc file used with link library for 32 bit applications

.386

.model flat,stdcall

.stack 4096

ExitProcess proto,dwExitCode:dword

INCLUDE Irvine32.inc

.data

myArray DWORD 0,2,5,9,10

arrSize = ($-myArray)/TYPE myArray

gapArr DWORD arrSize-1 DUP(?)

sum DWORD ?

.code

main PROC

;Call the procedure

call Clrscr

;Initialize ESI pointer

mov esi, 0

mov ecx, arrSize

dec ecx

L1:

mov eax, myArray[esi+4]

sub eax, myArray[esi]

mov gapArr[esi], eax

inc esi

loop L1

;Calculate the sum of gaps between array elements

mov sum, 0

mov esi, 0

mov ecx, arrSize

dec ecx

;  move gapArr[esi] to a temporary register and then add that register value to sum

L2:

mov edx, gapArr[esi]  

add sum, edx

inc esi

loop L2

       INVOKE ExitProcess,0

main ENDP

END main

Explanation:

You might be interested in
An installation is:<br> please help asap
pogonyaev

Answer:  an installation is the act of putting something in, a device that stays in one place, a military base, or an art piece that often involves building and different types of materials.

Explanation:

Getting your new air conditioner put in is an example of an installation.

4 0
3 years ago
If you have two tasks x and y, with y being a successor to x, if we mark x as undone (because it needs to be redone for some rea
Ierofanga [76]

Answer:

idk

Explanation:

sorry

7 0
3 years ago
A group of users in a small publishing office want to share large image files in a common folder with high availability. Which o
mash [69]

Answer:

Network storage appliances

Explanation:

Because I just took a test

7 0
3 years ago
Which of the following views would you use to see your Web page while working on it?
brilliants [131]
D) Alt Tags thats the answer i think
8 0
3 years ago
A data analyst is using the Color tool in Tableau to apply a color scheme to a data visualization. They want the visualization t
alina1380 [7]

Answer:

Color contrast is the difference in light between font (or anything in the foreground) and its background.

Explanation:

In web accessibility, how well one color stands out from another color determines whether or not most people will be able to read the information.

Contrast makes things look different and stand out

6 0
3 years ago
Other questions:
  • The tone a writer takes is referred to as the writing _____.
    7·2 answers
  • Which action is LEAST important to maintaining a healthy credit score?
    8·2 answers
  • Bill downloaded an antivirus software from the Internet. Under the Uniform Commercial Code (UCC), the software is a: Select one:
    15·1 answer
  • A coworker is concerned about the veracity of a claim because the sender of an email denies sending it. The coworker wants a way
    6·1 answer
  • You can access a button s screentip by _____.
    6·1 answer
  • How can I do a project with a model on the steam machine?
    14·1 answer
  • What does ctto mean?
    11·2 answers
  • 7.
    15·1 answer
  • _____the measuring instrument is not necssery​
    10·1 answer
  • Employers are looking for an employee?<br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!