Question

3. Write a complete assembly language program to read two matrices (2-dim arrays) A and B...

3. Write a complete assembly language program to read two matrices (2-dim arrays) A and B and display the resulting matrix C, which is the sum of A and B. Procedures must be used to organize the code.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

386 MODEL flat,stdcall STACK 4096 extern ExitProcess@4: Near data array2D ows by 4 Columns Data area Dword 1,2,3,4 Dword 5,6,push offset columnsumArray push offset rowSumArray push 4 push 3 push offset array2D call Sum2DimArray push Blac k box. AlwayDescription: this function sum the rows item in the 2d array and put it in the r owSumArray, and sum the columns and pu t itmov ebp,esp push ecx push eax push ebx push esi 2d array item pointer push edx mov eax, 0 mov ebx, O rows counter columns couColumnsLoop: columns loop mov ecx, [esi] ecx is the current value mov add mov add edx, [ebp+rowsSumArray] [eax-type dword*eaxcmp jne ebx, [ebp-columnsNumPlace] ColumnsLoop inc cmp jne eax eax, [ebp+row s NumPlace] RowsLoop pop edx pop esl pop ebx pop

Add a comment
Know the answer?
Add Answer to:
3. Write a complete assembly language program to read two matrices (2-dim arrays) A and B...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Java program that will - read two 2x3 matrices A and B. - compute...

    Write a Java program that will - read two 2x3 matrices A and B. - compute their sum (C=A+B) - print out the C matrix Please write out code. No screen shots please.

  • Need help with this program which needs to be done in C++ 2 dim arrays as...

    Need help with this program which needs to be done in C++ 2 dim arrays as Matrices (30 pts) Given matrices A and B as shown below: Write functions to do each of the following jobs for 3X3 systems: initem, readem, writem, addem, subtractem, do scalar multiplication, and matrix multiplication. Do each math function using A and B below. Print each resulting solution matrix with a call to writem, along with an appropriate message. Use k = -2 for the...

  • Write a C++ program to read two matrices with any size. Your program should have at...

    Write a C++ program to read two matrices with any size. Your program should have at least the following functions: Main() Read a matrix Add two matrices Subtract two matrices Multiply two matrices Divide two matrices Display a matrix

  • in c++ Develop a program (name it AddMatrices) that adds two user provided matrices. The matrices...

    in c++ Develop a program (name it AddMatrices) that adds two user provided matrices. The matrices must of the same size. The program defines method Addition() that takes two two-dimensional arrays of integers and returns their addition as a two-dimensional array. The program main method defines two 3-by-3 arrays of type integer. The method prompts the user to initialize the arrays. Then it calls method Addition(). Finally, it prints out the array retuned by method Addition(). Document your code, and...

  • Assembly Language////Write a program that read in 10 integers from the user. Save the numbers into...

    Assembly Language////Write a program that read in 10 integers from the user. Save the numbers into an array; reverse the array and display the reversed array. .data arrayInt DWORD 10 DUP(?) Your program consists of 4 procedures: 1. main procedure: call procedures getInput, reverseArray, displayArray 2. getInput procedure: prompt user to enter 10 integer numbers, save the numbers into the memory for the arrayInt 3. reverseArray: reverse arrayInt 4. displayArray: display the reversed array

  • Write a java program that will read the values for 3 matrices A, B, and C...

    Write a java program that will read the values for 3 matrices A, B, and C and store the result of their summation in matrix D. You need to use a method to read matrix values. Use another method to add the three 3x3 matrices (each is a 2 dimensional array with 3 rows and 3 columns). Finally, use a third method to print the value of the summation (matrix D). Write a test program that will cal the three...

  • Language C Code Write a program that takes two integer arrays (A and B) and sums...

    Language C Code Write a program that takes two integer arrays (A and B) and sums them together (element wise). A third array to accept the result should be passed in as the output argument. Assume the arrays are all the same size. The argument N is the size of the arrays. Your code should provide a function with the following signature: void array Addition (int A[], int B[], int N, int output[]) { } Your code must also provide...

  • Assembly Language Program Help Write a procedure named CountNearMatches that receives pointers to two arrays of...

    Assembly Language Program Help Write a procedure named CountNearMatches that receives pointers to two arrays of signed doublewords, a parameter that indicates the length of the two arrays, and a parameter that indicates the maximum allowed difference (called diff) between any two matching elements. For each element x(i) in the first array, if the difference between it and the corresponding y(i) in the second array is less than or equal to diff, increment a count. At the end, return a...

  • C++ Write a program to calculate the sum of two matrices that are stored inside two-dimensional...

    C++ Write a program to calculate the sum of two matrices that are stored inside two-dimensional arrays. Your program should include three functions: one for getting input data, one for calculating the sum of matrices, and one for printing the result. a) Function inputMatrix: This Function prompts the user to enter the data and stores data inside two-dimensional array. b) Function addMatrices: This function calculatesthe sum result of two matrices. c) Function printMatrix: This function prints the matrix to screen....

  • IN SPARC ASSEMBLY ONLY, write a program that prompts the user for two numbers and prints...

    IN SPARC ASSEMBLY ONLY, write a program that prompts the user for two numbers and prints the sum. THIS MUST BE IN SPARC ASSEMBLY. DO NOT WRITE IT IN NORMAL ASSEMBLY LANGUAGE. Sample: Enter Number 1: 2 Enter Number 2: 3 The sum of 2 and 3 is 5 Note: -Your program should contain .data, .bss, and .text sections -DO NOT try to optimize your code (i.e remove nops) -DO NOT write this in regular assembly, it must be in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT