Question

Given an array labeled as array1 with the values: 11111h, 22222h, 33333h, 44444h And another array...

Given an array labeled as array1 with the values: 11111h, 22222h, 33333h, 44444h And another array labeled as array2 with the values: 0AEFFh, 23CAH, 1156H Sum up BOTH arrays through indirect addressing with a loop and place the sum into the EAX register. Assembly

Homework Answers

Answer #1

ANSWER :

Given :

array 1  values: 11111h, 22222h, 33333h, 44444h

array 2 values: 0AEFFh, 23CAH, 1156H

Assembly Code:

lea esi,array1 ;load the address of array1 to esi

lea edi,array2 ;load the address of array2 to edi

mov eax,[esi] ;load the first number from array1 to eax

add esi,2 ;increment the address to point to the next number in array1

add eax,[esi] ;adding the second number with first number

add esi,2 ;increment the address

add eax,[esi] ;adding third number

add esi,2 ;increment the address

add eax,[esi] ;adding fourth number

add eax,[edi] ;adding first number of array2 with the sum of array1

add esi,2 ;increment the address of array2

add eax,[edi] ;adding the second number

add edi,2 ;increment the address

add eax,[edi] ;adding the third number and store the answer in register eax

hlt

**************** END ******************

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Given the following array, add the each element corresponding to its position to form a new...
Given the following array, add the each element corresponding to its position to form a new array in array1: (In-direct Addressing) .data array1 DWORD 0A1223D48h, 11DE33ABh, 11223344h array2 WORD 0FFFFh, 0A123h, 556Ch .code
Given an array of integers return the sum of the values stored in the first and...
Given an array of integers return the sum of the values stored in the first and last index of the array. The array will have at least 2 elements in it --------------------------------------- public class Class1 { public static int endSum(int[] values) {     //Enter code here } }
Arrays, loops, functions: Lotto Element Repeated Function Write a function that that takes as parameters an...
Arrays, loops, functions: Lotto Element Repeated Function Write a function that that takes as parameters an array of ints, an int value named element, and an int value named end. Return a bool based on whether the element appears in the array starting from index 0 and up to but not including the end index. Generate Random Array Write a function that takes as parameters an array of integers and another integer for the size of the array. Create a...
In assembly masm use the code below! Write a program that reverse a string using indirect...
In assembly masm use the code below! Write a program that reverse a string using indirect addressing (may not use the stack - push/pop). The string will be given by the user and be up to 64 characters long INCLUDE Irvine32.inc INCLUDE macros.inc MAX = 64 .data source BYTE MAX DUP('#'),0 destination BYTE LENGTHOF source DUP('*'),0 actual_length DWORD ? ask BYTE "Enter a String: ",0 .code main proc ; ask user for input mov edx, OFFSET ask call WriteString ;...
Topics Arrays Accessing Arrays Description Write a C++ program that will display a number of statistics...
Topics Arrays Accessing Arrays Description Write a C++ program that will display a number of statistics relating to data supplied by the user. The program will ask the user to enter the number of items making up the data. It will then ask the user to enter data items one by one. It will store the data items in a double array. Then it will perform a number of statistical operations on the data. Finally, it will display a report...
**please write code with function definition taking in input and use given variable names** for e.g....
**please write code with function definition taking in input and use given variable names** for e.g. List matchNames(List inputNames, List secRecords) Java or Python Please Note:    * The function is expected to return a STRING_ARRAY.      * The function accepts following parameters:      *  1. STRING_ARRAY inputNames      *  2. STRING_ARRAY secRecords      */ Problem Statement Introduction Imagine you are helping the Security Exchange Commission (SEC) respond to anonymous tips. One of the biggest problems the team faces is handling the transcription of the companies reported...
Java question, Please answer everything. Thank you Answer the following questions as briefly (but completely) as...
Java question, Please answer everything. Thank you Answer the following questions as briefly (but completely) as possible: What is a checked exception, and what is an unchecked exception? What is NullPointerException? Which of the following statements (if any) will throw an exception? If no exception is thrown, what is the output? 1: System.out.println( 1 / 0 ); 2: System.out.println( 1.0 / 0 ); Point out the problem in the following code. Does the code throw any exceptions? 1: long value...
Case Study Read the case study given below and answer all the questions that follow. SONY...
Case Study Read the case study given below and answer all the questions that follow. SONY : High Quality and Technological Innovation introduction Throughout the 20th century, the pace of technological advancement has increased dramatically. The digital revolution, now upon us, will see further massive steps forward. This case study looks at the ways in which Sony has been able to stay at the leading edge of the new technologies. Sony Corporation is the leading manufacturer of audio, video, communications...
      MK Restaurant: Branding of Thai-Style Hotpot The restaurant industry is one of the most...
      MK Restaurant: Branding of Thai-Style Hotpot The restaurant industry is one of the most competitive in Thailand. With a large number of players ranging from restaurants in five-star hotels, global fast-food chains to small stalls along the streets and everything in between, the Thais are spoiled for choice. In addition, as the world becomes globalized, consumers are familiar with international dishes and would not hesitate to try new offerings from the other side of the globe. As a...
What are 4 key things you learned about the topic from reading their paper? How does...
What are 4 key things you learned about the topic from reading their paper? How does the topic relate to you and your current or past job? Critique the paper in terms of the organization and quality. Team 3 answer questions above. Part I In today’s world we see fear among people when dealing with sexual harassment. This leads to people not reporting sexual harassment. A misconception about sexual harassment is that it’s only about touching and forcing other people...