Describe the steps and tools used in debugging your program

Assignment Help Other Engineering
Reference no: EM131657501

Lab Assignment- Using Subroutines and Macros

Overview

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: EM131657501

Questions Cloud

What kinds of evidence would help to support your opinion : Do you think a physical keyboard is necessary for your own computer work and creativity? What kinds of evidence would help to support your opinion?
Call option with the same exercise price : A put option that expires in six months with an exercise price of $30 sells for $4.10.
How effectively did researchers address project opportunity : What was the social problem/issue the study and/or initiative was intended to address? Do you think the project scope and design was well suited.
Build a factory addition for scroge by a particular date : Tinker Construction had a contract with Scroge to build a factory addition for Scroge by a particular date. The contract contained a penalty clause exacting.
Describe the steps and tools used in debugging your program : Document and submit your final report along with the well documented list file. Also describe the steps and tools used in debugging your program.
Beta of portfolio : If you made an equal dollar investment in each stocks what would be the beta of your portfolio? Please show your work.
What is motivation behind employee stock option : What is motivation behind Employee Stock Option? Is it that the accrual basis accounting is distorting the firm's liquidity and solvency ratios?
Discuss particular context and nature of services marketing : MKTG208 Services Marketing Assessment. To discuss the particular context and nature of services marketing
Discuss agreement for the sale of the artwork : The bank claimed that there was no agreement for the sale of the artwork and that there had been mutual mistake. Is the bank correct?

Reviews

Write a Review

Other Engineering Questions & Answers

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

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