Write and debug the code to add the two integers

Assignment Help Computer Engineering
Reference no: EM131860900

Assignment

The purpose of this lab is to program the MC8051 to add multi bytes two signed integers.. To simplify our laboratory, we will assume three bytes long (24 bits) signed integers. Each of the three bytes will be defined in three consecutive code memory bytes using the "DB" assembler directive. The program will store the answer in three consecutive data memory bytes starting at Ram address 40H. The program will also display the answer on P0, P1, and P2 staring with the LS Byte in P0. Port 3 pin 0 (P3.0) will be set if an overflow takes place, otherwise it will stay cleared. Three versions of the program will be implemented starting with all code included in one main program. The second implementation will employ two subroutines to make advantage of the repeated code blocks. The final implementation will utilize two Macros to reduce the size of the source program and improve its readability.

Steps

1. First, configure your code and data memory. The "MAIN:" program starts at code memory location 30H. The first integer uses code memory locations 100H, 101H, and 102H in the Intel MC8051 little endian format. The second integer uses code memory locations 105H, 106H, and 107H.

2. Second, configure parallel port 0, port 1, port 2, and P3.0 for output. Write and debug the code to add the two integers and store the answer in data memory locations 40H, 41H, and 42H. Update P0, P1, and P2 to display the same addition result. Flag an overflow condition on P3.1 by setting it.

3. Third, rewrite the program utilizing subroutines to make use of the repeated code blocks. Define the created. Subroutines after the main program before the program "END" directive.

4. Fourth, rewrite the program utilizing Macros to make use of the repeated code blocks. Define the created. Macros before the main program code. Unlike labels, the assembler will issue an error if Macros are not defined before they get referenced. Every Macro must end with "EMAC" directive. The Macro starts by its name followed by the word "MACRO". Example of a "SUM" Macro is the following:

SUM?MACRO

EMAC

Type the name of the Macro at desired locations in your assembly source program as needed for the assembler to insert the Macro object code in the final object file.

5. Fifth, check the three programs for different integers and verify the overall operations. Make sure to test cases producing an overflow. Also make use of break points in the Keil debugger to enhance and speed up the checkout.

6. Document and submit your final report along with the well documented list file. Also describe the steps and tools used in debugging your program.

7. Describe how to modify / redesign your program to perform the addition of two multi bytes integers up to 16 bytes long; one stored at code memory starting address of 100H and the other at 110H. The length of the two integers is input from port 3 (P3). The answer is stored at data memory starting at address 40H through 4FH.

Reference no: EM131860900

Questions Cloud

What are the six steps for requirements engineering : What are the six steps for requirements engineering? Describe the job of the requirements engineer with respect to stakeholder collaboration?
What term describes the use of one own culture : What term describes the use of one's own culture as a yardstick for judging the ways of individuals or societies, which generally leads to negative evaluations?
Explain the indirect conflict management strategy : In a course team where members are arguing over content choices for a PowerPoint presentation, it might help to remind everyone that the goal is to impress.
Determining the propaganda paradox : The Propaganda Paradox states that throughout American history, political, social, religious, and economic leaders have often used enlightened
Write and debug the code to add the two integers : Write and debug the code to add the two integers and store the answer in data memory locations 40H, 41H, and 42H. Update P0, P1, and P2 to display.
Summarize the advantages of disadvantages of modular data : Why is the availability of high-speed, high bandwidth communications an important consideration in data center consolidation plans and decision-making?
Discuss about communication principles : Identify the two (2) most valuable lessons you learned about communication principles from this course. Provide at least two (2) examples to support.
Discovery of america : 'The discovery of America and that of the passage to the East Indies by the Cape of Good Hope, are the two (2) greatest events recorded in the history
Create an argument against using a simulation : Create an argument against using a simulation. You can create a general argument or describe a real or fictional example that would not work well.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Compare relative merits of super pipelined and super scalar

Describe the conditions under which an n-stage pipeline is n times faster than a serial machine.

  Determine type of evaluation method to use in a web design

Determine the type of evaluation method to use in a Web design for the best user experience. Provide key details of how the mobile self-service will be implemented on various mobile devices.

  Which process is the best choice

In SQL Server, multiple WHERE statements can accomplish almost everything that a UNION can. TRUE OR FALSE. Justify your reply . This question is not asking that method is the best choice or the more efficient. It is simply asking is it possible.

  What are some trends which computer support has witnessed

what are some trends that computer support has witnessed over the past 10 years? how does the cost benefit of

  Questionthis program creates basic user interface code for

questionthis program creates basic user interface code for that can be re-used in following weeks ilab assignments. the

  How a box of caramel delites girl scout cookies

How to a box of Caramel deLites Girl Scout cookies Every spring you looking forward to buying a box of Caramel deLites Girl Scout cookies

  Write a function that looks for a string present

Write a function that looks for a string present in another string and enclosed in tags, extract it, and return the index position of the string.

  Identify and assess fraud that occurred in the organization

Based on your research, identify and assess the fraud that occurred in the organization, as well as the impact that the fraud had on the corporation's investors

  Evaluate each point to determine the most important three

Imagine only three points are to be rolled out in the first phase. Evaluate each point to determine the most important three for the initial rollout phase.

  Web security consulting recommendations

Web Security Consulting Recommendations You are a security consultant for a new client in the healthcare industry. You have been asked to design a web solution

  Understanding rms values and peak values of voltage current

Understanding rms values and peak values of voltage/current, A personal computer that has a built in monitor and keyboard requires 40W at 115V(RMS).

  Write press release announcing latest triple-play package

In a 1-page paper, write a press release announcing the latest triple-play package that your telecommunications company is releasing Describe each of the services provided, and why they are 'must have" services for the customer. Be as creative as ..

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