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
When you create a user with the useradd command, what is the immediate state of it?
kipiarov [429]

When a user is created in Linux using the useradd command, the <em>immediate state</em> of the created account is locked.

  • The useradd command can be invoked in other to create a new user account using the following command

sudo useradd fast_user

<em>#fast_user</em><em> </em><em>is</em><em> </em><em>the</em><em> </em><em>name</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>account</em><em> </em><em>created</em><em> </em>

  • At this point, the account has been created but it will be locked until the required login details are set. This can be achieved using the line ;

sudo passwd fast_user

Therefore, an account created using the useradd command is in a locked state.

Learn more :brainly.com/question/12135504?referrer=searchResults

5 0
2 years ago
____ is a limited version of windows that allows you to use your mouse, screen, and keyboard but no other peripheral devices.
Gnoma [55]
'SAFEMODE' <span>is a limited version of windows that allows you to use your mouse, screen, and keyboard but no other peripheral devices.</span>
8 0
3 years ago
PLEASE HELP ME! Will report ignorant answers!
kaheart [24]

Answer:

It is important so your computer can function properly. the two things that might happen if they are not compatible are that it might crash your computer and that your computer might not function properly.

5 0
2 years ago
How do you optimize a website using JavaScript?
GenaCL600 [577]
You can edit the website (using Wordpress) -if it is your website of course-, and code JavaScript commands into the page that’s going to be uploaded.

Check out my website: www.birdbloggersblog.com

I coded that with HTML.
4 0
2 years ago
You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
AlexFokin [52]

Answer:

ECC memory

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the best type of RAM for this situation would be ECC memory (RAM). This abbreviation refers to Error-Correcting-Code, this memory can detect and correct many common types of errors, and is used mainly for servers or when sensitive data is involved where errors and data corruption cannot be allowed to happen under any circumstance.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

3 0
3 years ago
Other questions:
  • Keisha has been asked to give a presentation about a new method for processing customer returns. The first thing she should do i
    11·1 answer
  • Your hometown probably has little to offer in terms of photography because you've already seen it. True False
    14·1 answer
  • Adele’s mother owns a Daycare and she wants to learn all about this business, to help her mom and own it one day. Which CTSO sho
    9·1 answer
  • Is a book considered technology?
    8·2 answers
  • Who made the first sandwich?
    5·2 answers
  • Assignment 4: Evens and Odds<br><br><br> How do I fix this?
    13·1 answer
  • Victoria has a .... of playing with her hair when she gets nervous​
    9·1 answer
  • What is the velocity of a 0.100kg car with a momentum of 5 kgm/s?
    12·1 answer
  • What are the importance of computer software​
    9·2 answers
  • What is cpu?<br>please give me right answer ​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!