Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is one question with 3 parts. please answer all of it The purpose of this lab is to program the MC8051 to add nwlti
this is one question with 3 parts. please answer all of it
The purpose of this lab is to program the MC8051 to add nwlti bytes wo 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 wil store answer in three consecutive data memory bytes starting at Ram address 40H. The program will also display the answer on PO, Pl. and P2 starirlg with the LS Byte in PO. Port 3 pin O (P3.O) wil be set if an overflow takes place. otherwise it will stay cleared. Three versions of the program will be implemented starting with all code induded in one main program. The second implementation win employ two subroutines to make advantage Of the repeated code blocks. The final irnplementation utilize two Macros to reduce the size of tie source program and inprove its readabUity. First. nfigure your code and data maTWty. The MAIN:' program starts at code memory location 30H. The first integer uses code memory locations IOOH, IOIH, and 102H in fre Intel MC8051 little endian fomat. The sewnd integer uses code nwrmry lotions 105H, 1061--1. and 10TH. Second, configure paranel port O. port 1. port 2, and P3.O for output. Write and debug code to add the two integers and store the answer in data memory locations 40H, 41H, and 42H. Update PO. Pl. and P2 to display the same additon resuR. overflow mndition on P3.1 by setting it. Third, tle program utilizing subrounes to make use of repeated code blocks. Define the created. Subroutines after the main bebre the progran ENT
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started