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...
PLEASE SOLVE WILL RATE AND THUMBS UP Simple assembly code question: In this question you will...
PLEASE SOLVE WILL RATE AND THUMBS UP Simple assembly code question: In this question you will write a simple program to loop through an array (i.e., writing while statements in assembly) of non-zero numbers. Write an LC3 assembly program for converting a list of non-zero integers into their absolute values. The program starts at x3000. It will first load the address ARRAY of the start of the list into register R0. After this, R0 now contains the location in memory...
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 ;...
Problem Definition: Problem: Given an array of integers find all pairs of integers, a and b,...
Problem Definition: Problem: Given an array of integers find all pairs of integers, a and b, where a – b is equal to a given number. For example, consider the following array and suppose we want to find all pairs of integers a and b where a – b = 3 A = [10, 4, 6, 16, 1, 6, 12, 13] Then your method should return the following pairs: 4, 1 15, 12 13, 10 A poor solution: There are...
Complete the java code as per the comments public class Sorting {    ///////////////////////////////////////////////    //...
Complete the java code as per the comments public class Sorting {    ///////////////////////////////////////////////    // STEP 1 -- Make sorting methods generic    ///////////////////////////////////////////////       /**    * Re-orders the contents given array using the insertion sort algorithm.    *    * @param data The array to be sorted.    */    //TODO: Make me generic to work on any kind of Comparable data!    public static void insertionSort(int[] data)    {        int insert; // temporary...
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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT