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
Computer-integrated manufacturing (CIM) includes manufacturing systems that have:
Allushta [10]

Answer:

The correct answer to the following question will be Option A.

Explanation:

It is generally understood today that perhaps the reach of computer applications and programs needs to expand throughout architecture and engineering to cover the company's corporate operations.

This technology comprises of machine learning or computer programmed to execute certain various tasks and transmit information from various sectors of that same business or market.

Some elements of CIM includes:

  • Controllers.
  • Connectors.
  • Printers.
  • Cables.
  • Workstations.
  • Terminal data access.
8 0
3 years ago
The ____ layer of the osi model performs a series of miscellaneous functions necessary for presenting the data package properly
Darya [45]
The "transport" layer of the OSI model performs a series of miscellaneous functions
Machine function also called miscellaneous functions—influence. positive functions on the machine, such as diverting the spindle rotation and coolant on and off, the path action of the tool, and the program beheading.
7 0
3 years ago
If there is an int/integer in a array, and the same int/integer comes at the same spot, does it cancel each other out or does it
joja [24]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

When you use an array in the program, it occupies the memory where to store the data. However, it is noted that the other array cannot store the variable value where the first array has to store its variable value.

however, when you reassign the value their index position of the array, the values are reassigned. But it also depends on the CPU, because sometimes when you release the memory from the array, maybe some other programs get to occupy that location where the first array values were stored.

However, In Java, it is possible that the same int/integer comes at the same spot of the existing integer in an array, then the value at that particular index is reassigned.

7 0
3 years ago
Why the car floated before it started to sink? Explain.​
zhenek [66]

Answer:

it still had air in it

Explanation:

its simple

8 0
3 years ago
You want to design a small portable computer system with memory that can be updated, but that does not lose its contents when th
garri49 [273]

Answer:

CMOS

Explanation:

CMOS stands for complementary metal oxide semiconductor.  CMOS is in the design of several types of semiconductors. in most computers there are CMOS that are powered by the PC's batteries to save the memory state of  date, time, and system setup parameters when the PC looses power. In the question above, given the specified parameters for the new system, a CMOS chip will serve perfectly

7 0
3 years ago
Other questions:
  • Write a program that prompts the user to enter an equation in the form of 10 5, or 10-5, or 1*5, or 13/4, or 13%4. The program s
    6·1 answer
  • The media is a phase that people often use to refer to:
    6·1 answer
  • Define a Python function named file_listers with two parameters. The first parameter will be a string specifying the name of the
    7·1 answer
  • A blank is a link on a web page that leads to another web page.
    14·1 answer
  • 4+4 act quick for brainliest
    10·2 answers
  • What is DBMS software used for?
    5·1 answer
  • Given the following function definition, what modifications need to be made to the search function so that it finds all occurren
    7·1 answer
  • 15. The most efficient way to perform data entry is to keep your hands on the keyboard and press _______ to move to the next cel
    13·1 answer
  • Photographs, illustrations, and videos are increasingly created an and viewed in digital formats. True or False​
    5·2 answers
  • 6.1.5: Function definition: Volume of a pyramid.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!