Ask Assembly Expert

Part 1:

Create a project called Practice 12. Copy RowSum.asm code found in Irvine examples chapter 9. Study the code and understand how a two dimensional array is accessed. The code uses a procedure called calc_row_sum to calculate a row sum. The row number is chosen by the user.

Modify the code so that it will calculate a column sum. For this create a procedure called calc_col_sum, which should look similar with the original procedure calc_row_sum. Use the same registers as calc_row_sum uses, and return the sum in EAX. Display the value in the console.

Your new program should be called Column Sum Calculation, which should be seen in title. As with the original code, ask the user to input a column number, which can only be between 0 and 4. The table is the same as in the original code. Calculate the sum for that column and display it together with the column number.

Here is an example:

948_Calculate the sum for that column and display.png

Requirements:

1.If you need intermediary values to be stored/saved do not use the main memory. Use the stack.

2. Create a procedure called calc_col_sum which uses the same registers as the original procedure EBX ECX EDX ESI.

3. The procedure return value should be in EAX.

4. The program output has to show the sum and the column chosen by the user.

5.You may define constants in the data section like the RowSize or ColSize.

Verify it builds and runs, archive it and upload it in the Student Submissions area.

Part 2:

Create a procedure called replaceChar that will replace the first character found in an array with a specified character. Your procedure should take as parameters the address of a BYTE array to search, the character to search for, and the character to replace with.

In the main program call this procedure until all matching characters are replaced. Every time you replace a character, print the whole array to show the replacement progress. For this, write another procedure called, say, printText which will print your array. printText procedure should take as parameters the address of a BYTE array

Your code should also place in the eax register the number of characters replaced and display this number on screen.

To test your procedure ask the user to input a text of maximum 40 characters. Ask him to also input the character he wants to replace, and the character to replace with. Output any appropriate messages that you feel are needed to make the program clear to the user.

Some specifics:

Your replaceChar procedure should be in it's own .asm file. You should call this procedure from your main procedure in the main.asm file, with INVOKE.

Your printText procedure should be in it's own .asm file. You should call this procedure from your main procedure in the main.asm file, with INVOKE, any time you need to print the text on screen.

Use a .inc file to keep the procedures prototypes and the inclusion of the Irvine procedures.

When the program ends report the number of replacements made.

So, to be clear, for this assignment your project has to have 3 .asm files and one .inc file.

1000_Calculate the sum for that column and display1.png

Assembly, Programming

  • Category:- Assembly
  • Reference No.:- M91257713

Have any Question?


Related Questions in Assembly

Really need to find a correct answer to this questionwrite

Really need to find a correct answer to this question: Write a MIPS assembly program that can search for a number that is entered by a user in an array with 20 integer number. Make sure it also prints the index of the ar ...

Question a sequence string of one-byte ascii characters is

Question : A sequence (string) of one-byte ASCII characters is stored at memory location $600 onward. A second sequence of equal length is stored at memory location $700 onward. Each sequence ends with the character $0 ( ...

Task 1using masm sdk write an assembly language program

TASK 1 Using MASM SDK, write an assembly language program which converts an integer inputted via the console to binary. Your program should be well commented and well formatted. TASK 2 Using MASM SDK, write an assembly l ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As