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
andreev551 [17]
3 years ago
10

Summing Three Arrays Write an assembly language subroutine that receives the offsets of three arrays, all of equal size. It adds

the second and third arrays to the values in the first array. When it returns, the first array has all new values. Write a test program in C/C++ that creates an array, passes it to the subroutine, and prints the contents of the first array.
Computers and Technology
1 answer:
Delvig [45]3 years ago
7 0

Answer:

SumThreeArrays PROC USES eax ebx esi,

  array1:PTR DWORD, array2:PTR DWORD,

  array3:PTR DWORD, arraySize:DWORD

  LOCAL sz:BYTE       ; local sz for jump

  mov sz, 4                   ; size of each iteration jump

  mov ecx, arraySize           ; set ecx to size of arrays for loop

L1:

  mov eax, arraySize           ; move array size into eax

  sub eax, ecx               ; subtract whats left

  mul sz                       ; multiply by 4 to know how much to jump  

  mov esi, array1               ; set esi to start of array 1

  mov ebx, [esi+eax]           ; move value of esi+jump into ebx

  mov esi, array2               ; set esi to start of array 2

  add ebx, [esi+eax]           ; add value of esi+jump to ebx

  mov esi, array3               ; set esi to start of array 3

  add ebx, [esi+eax]           ; add value of esi+jump to ebx

  mov esi, array1               ; set esi to start of array 1

  mov [esi+eax], ebx           ; move value of ebx into esi+jump

  LOOP L1

  ret

SumThreeArrays ENDP

END

Explanation:

The subroutine "SumThreeArrays" from the assembly language gets from memory three defined arrays from a C++ source code and extend the size of the first array with the values of the second and the third arrays.

You might be interested in
Why should you not perform any personal grooming task while driving?
VLD [36.1K]

Answer:

Drivers most capable of multitasking effectively are not those who are most likely to engage in multiple tasks simultaneously. Instead, people who score high on a test of actual multitasking ability tend not to multitask because they are better able to focus attention on the task at hand.

Explanation:

8 0
4 years ago
Read 2 more answers
Sql statements that define the objects such as tables, indexes, triggers, etc. in a database are referred to as _______________
tatuchka [14]
Source statements i hope this helped

3 0
3 years ago
In general, the outside _____ and sleeves of the isolation gown and outside front of the goggles, mask, respirator and face shie
diamong [38]
The answer to this question is the letter "A" which is TIES. In general, the outside TIES and sleeves of the isolation gown and outside the front of the goggles, mask, respirator and face shield are considered "contaminated" regardless of whether there is visible soil.
7 0
3 years ago
Read 2 more answers
A wall is built of bricks. What force is being applied to each brick from the bricks above? ​
ValentinkaMS [17]

Answer:

Gravitational Pull is the force that is being applied to each brick.

5 0
3 years ago
Which aspect of business does accounting measure?
VladimirAG [237]

financial aspect

Accounting measurement is the computation of economic or financial activities in terms of money, hours or other units. An accounting measurement is a unit of some measurable element that is used to compare and evaluate accounting data. Accounting is often measured in terms of money.

6 0
3 years ago
Other questions:
  • Materials that allow electricity to flow are called A) Metals B) Attractors C) Conductors D) Insulators
    11·2 answers
  • OBJECTIVE This project will familiarize you with the use of pthreads, pthread mutexes and pthread condition variables. Your prog
    9·1 answer
  • What is encyclopedia. Com considered to be?
    14·1 answer
  • It is important to create an IT security program structure that aligns with program and organizational goals and describes the o
    6·1 answer
  • Which of the following is a reason that a drug may not receive FDA approval?
    15·1 answer
  • Alright, so I have a wireless mouse that uses a dongle (it's not Bluetooth nor wired). But recently I realized that none of the
    12·1 answer
  • In which area is composing for games similar to composing for
    14·1 answer
  • Use the drop-down menus to answer questions about the options in the Window group. Which command allows a user to view presentat
    6·2 answers
  • Dis-cord and/or snap????????????? Im 13 ! and a girl :)))))
    12·2 answers
  • Pick the correct statements on the 64-bit machine representation of numbers.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!