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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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