Study code and find how two dimensional array is accessed

Assignment Help Assembly Language
Reference no: EM13718318

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

Reference no: EM13718318

Questions Cloud

How much energy is transferred to the oxygen as heat : Suppose 12.2 g of oxygen (O2) is heated at constant atmospheric pressure from 25.3°C to 141°C. How much energy is transferred to the oxygen as heat
Calculate how far up the ramp does the block go : An 8.75-kg block is sent up a ramp inclined at an angle 29.5° from the horizontal. It is given an initial velocity v0 = 15.0 m/s up the ramp. How far up the ramp (in the direction along the ramp) does the block go before it comes to a stop
Calculate the reaction force to weight of the passenger : The upward normal force exerted by the floor is 720N on an elevator passenger who weighs 770N. What is the reaction force to weight of the passenger
Why are constituents of blood separated during centrifuge : A tube containing blood is being centrifuged (horizontally). Blood consists mostly red cells (largest mass) , Why are the constituents of blood separated during the centrifuge
Study code and find how two dimensional array is accessed : Create a procedure called calc_col_sum which uses the same registers as the original procedure EBX ECX EDX ESI - The procedure return value should be in EAX.
Obtain what is the radius of the planet : The escape speed from a distant planet is 45 km/s. If the acceleration of gravity on the planet surface is 12.5 m/s2, what is the radius of the planet
Determine how fast must you project an object for it : How fast must you project an object for it to reach a height equal to the moon's distance from the earth? Ignore the gravitational attraction of the moon
Estimate the initial speed of the lighter car : A 1000- kg car collides with a 1300- kg car that was initially at rest at the origin of an x-y coordinate system. What was the initial speed of the lighter car
Estimate the shear modulus of the eraser material : A cylindrical eraser of negligible mass is dragged across a paper at a constant velocity to the right by its pencil. The coefficient of kinetic friction between eraser and paper is 0.640. The pencil pushes down with 3.80N. Determine the shear modu..

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd