Write an assembly program that calculates the edit distance

Assignment Help Assembly Language
Reference no: EM13963323

Names of Files to Submit: 64bitAdd.s, editDist.s , div.c, divAssembly.s, ReadMe.txt

• If you are working in a group ALL members must submit the assignment

• All programs should compile with no warnings when compiled with the -Wall option

• All prompts for input and all output must match my prompts/output. We use a program to grade your work and tiny differences can cause your work to be marked as a 0.

? The best way to avoid being deducted points is to copy the prompt/unchanging portion of the outputs into your code. Make sure to get the spaces as well.

• You must also submit a file called ReadMe.txt. Include the names of all partners and any trouble you had on the assignment

• An example ReadMe.txt has been included with this assignment

• The input in the examples has been underlined to help you figure out what is input and what is output

• Submit your work on Smartsite by uploading each file separately. Do not upload any folders or compressed files such as .rar, .tar, .targz, .zip etc.

• If you have any questions please post them to Piazza

1. Write an assembly program called 64bitAdd.s that adds two 64 bit numbers together.

1) The first number will be referenced by the label num1 and the second number will be referenced by the label num2.

2) The upper 32 bits of the sum should be placed in EDX and the lower 32 bits in EAX.

3) AFTER the last line of code that you wish to be executed in your program please place the label done.

4) I have included a Makefile for you that will compile your program.

5) IT IS OF VITAL IMPORTANCE THAT YOU NAME YOUR LABELS AS SPECIFIED AND MAKE THE APPROPRIATE AMOUNT OF SPACE FOR EACH VARIABLE! I will be using gdb to test your code and if your labels do not match then the tests will fail. You must also make sure to include the done label AFTER the last line of code you want executed in your program so that I know where to set break points.

6) The following table shows how the numbers will be laid out in memory.

num1:

Upper 32 bits of num1

Lower 32 bits of num1

num2: Upper 32 bits of num2 Lower 32 bits of num2

2. Write an assembly program called editDist.s that calculates the edit distance between 2 strings. An explanation of what edit distance is can be found here while accompanying pseudo code can be found here.

1. The label for the first string should be string1 and the label for the second string should be string2.
2. The edit distance between string1 and string2 should be placed in EAX.
3. For each string please allocate space for 100 bytes.

1. While you must allocate space for 100 bytes in your final submission you will likely find it easier to work with the .string directive for testing and debugging.

4. AFTER the last line of code that you wish to be executed in your program please place the label done.

5. I have included a C implementation of the edit distance program. I highly recommend translating this solution into assembly as it will make your life much easier.

6. I have included a Makefile that will compile your program. Your program must be able to be compiled by this Makefile when you submit it

7. IT IS OF VITAL IMPORTANCE THAT YOU NAME YOUR LABELS AS SPECIFIED AND MAKE THE APPROPRIATE AMOUNT OF SPACE FOR EACH VARIABLE! I will be using gdb to test your code and if your labels do not match then the tests will fail. You must also make sure to include the done label AFTER the last line of code you want executed in your program so that I know where to set break points.

3. Write a C program called div.c that implements division on two unsigned integers.

1. Name your executable div.out

2. You cannot use division in your solution

3. Arguments should be accepted from the command line

1. The first argument is the dividend

2. The second argument is divisor

4. Your program should display the quotient and remainder after doing the division

5. Your program must complete in O(1) time

1. This is possible because an integer is 32 bits long and so the loop that does the division should not take longer than 32 iterations.

2. Because of this restriction the following solution is not acceptable as it does not meet the O requirements

void bad_div(unsigned int dividend, unsigned int divisor,

unsigned int* quotient, unsigned int *remainder){

*quotient = 0;

while(dividend >= divisor){ (*quotient)++;

dividend -= divisor;

}

*remainder = dividend;

}

3. In order to meet the O requirements you will have to division in base 2 as you would by hand. See these 2 articles for some examples: Dr. Math and Exploring Binary

1. Hint: use bitwise operators

2. The one step that they leave out and one that you normally skip when doing division by hand is checking to see how many times the divisor goes into the dividend for the numbers that contain fewer digits than the divisor.

1. For example: 30 / 15

2. First we should check how many times does 15 go into 3. The answer is 0.

3. Then we check how many times does 15 go into 30, which is 2.

4. So our answer would be 02 R 0

4. Examples:

1. ./div.out 10 5 10 / 5 = 2 R 0

2. ./div.out 100 17

100 / 17 = 5 R 15

3.

4. Translate your C program from problem 3 into an assembly program called divAssembly.s.

1. The label for the dividend is dividend

1. 4 bytes of space should be made for the dividend

2. The label for the divisor is divisor

1. 4 bytes of space should be made for the divisor

3. Place the quotient in EAX

4. Place the remainder in EDX

5. AFTER the last line of code that you wish to be executed in your program please place the label done.

6. IT IS OF VITAL IMPORTANCE THAT YOU NAME YOUR LABELS AS SPECIFIED AND MAKE THE APPROPRIATE AMOUNT OF SPACE FOR EACH VARIABLE! I will be using gdb to test your code and if your labels do not match then the tests will fail. You must also make sure to include the done label AFTER the last line of code you want executed in your program so that I know where to set break points.

Attachment:- Assignment.rar

Reference no: EM13963323

Questions Cloud

Write a three pages essay on wireless lan management : Write 3 pages of essay in wireless LAN management but quality work no need to use reference only your words.
How might you connect them with one wire : How might you connect them with one wire? Show the path of the current in each case.
Determine the acceleration of block b : At t=0, wedge A starts moving to the right with a constant acceleration of 100 mm/s^2 and block B starts moving along the wedge toward the left with a constant acceleration of 150 mm/s^2 relative to the wedge. Determine the acceleration of block B..
Developing management capability : The aim of this assignment is to allow participants to explore and develop key capabilities in one of the two key managing others capabilities addressed in the course.
Write an assembly program that calculates the edit distance : Write an assembly program called editDist.s that calculates the edit distance between 2 strings. An explanation of what edit distance is can be found here while accompanying pseudo code can be found here.
What are the three basic services provided by parole agency : What are the three basic services provided by a parole agency? How does the independent model of parole administration differ from the consolidated model? What are the advantages and disadvantages of the independent model as opposed to the consolida..
Determine relative velocity of the block with respect to arm : A 1.2-lb block B slides without friction inside a slot cut in arm OA which rotates in a vertical plane at a constant rate, theta = 2 rad/s. At the instant when theta = 30 degrees, r = 2 ft and the force exerted on the block by the arm is zero. Det..
How the current passing through each cell when device in use : A credit card size calculator uses two tiny 1.5-V cells in series that provide a normal operating power of 0.000 18 W. Determine the current passing through each cell when the device is in use.
Traditional mobile banking and mobile money transfer : What are the differences between traditional mobile banking and mobile money transfer? And, compare and contrast the mobile banking scenario in India and in African countries.

Reviews

Write a Review

Assembly Language Questions & Answers

  White-collar assembly lines

White collar workers (who may not necessarily be considered high-skilled) are impacted in this case. Call centers and data processing centers are the "white-collar assembly lines" of IT. Accountants, medical transcriptionists, telemarketers, and o..

  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

  Prepare an assembly language program

Prepare an assembly language program that prints your full name on the screen. Use .ASCII pseudo-op to store the characters at the top of your program.

  Write a program in assembly language which uses bios

write a program in assembly language which uses bios interrupt int 21 to read current system time and displays it on

  Write reverse polish notation formula that cannot be convert

Write three reverse Polish notation formulas that cannot be converted to infix. Convert the following infix Boolean formulas to reverse Polish notation.

  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.

  Microcontroller assembly language programs

Write the following 8051 Microcontroller assembly language programs and simulate your programs in EDSIM 51 simulation

  What is the maximum number of one-address instructions

A certain machine has 16-bit instructions and 6-bit addresses. Some instructions have one address and others have two. If there are n two-address instructions, what is the maximum number of one-address instructions?

  Assembly language program that generates and displays

Write a assembly language program that generates and displays 20 random strings, each consisting of ten letter(A-Z, a-z)s or number(0-9)s.

  Describe advantage of program-counter-relative addressing

Describe one advantage and one disadvantage of program-counter-relative addressing. The Core i7 has a condition code bit that keeps track of the carry out of bit 3 after an arithmetic operation. What good is it?

  Write an isr and startup code for a system

Write an ISR and startup code for a system that lights up LED0 on a PSoC Eval1 board (suppose that a wire is connecting P1[0]) to show "Low Voltage" whenever there is a supply voltage monitor interrupt.

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