0% found this document useful (0 votes)
54 views1 page

Lab2 8051

This document outlines activities for a lab on data transfer in assembly language programming for the 8051 microcontroller. The objectives are to: 1) Transfer data from ROM to RAM, 2) Transfer data between RAM locations, 3) Exchange data between RAM locations using indirect addressing and DJNZ, 4) Find and display the largest element in an array stored in RAM, 5) Sort an array in RAM in ascending order. The activities provide example data and instructions for writing assembly code to complete each objective.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1 page

Lab2 8051

This document outlines activities for a lab on data transfer in assembly language programming for the 8051 microcontroller. The objectives are to: 1) Transfer data from ROM to RAM, 2) Transfer data between RAM locations, 3) Exchange data between RAM locations using indirect addressing and DJNZ, 4) Find and display the largest element in an array stored in RAM, 5) Sort an array in RAM in ascending order. The activities provide example data and instructions for writing assembly code to complete each objective.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

LAB 2

DATA TRANSFER
OBJECTIVES:
¾ Write an ALP to transfer data from code ROM space into RAM locations.
¾ Write an ALP to transfer data from RAM locations to other RAM locations.
¾ Write an ALP to Exchange Data between Internal RAM Locations.
¾ Write an ALP to Find the Largest Element in an Array Stored in the Internal RAM location,
and Display the Result in Port2.
¾ Write an ALP to Sort an Array stored in the Internal RAM location.
¾ To experiment with a look-up table.
REFERENCE:
¾ Mazidi and McKinlay, “The 8051 Microcontroller and Embedded Systems,”.

MATERIALS:
¾ Keil 8051 simulator & trainer board.
ACTIVITY 1
Write a program to transfer a string of data from code space starting at address 200H to RAM
locations inside the CPU starting at 40H. The data representing your last name and first name is
as shown below:
MYDATA: DB "Firstname Secondname",0
Using the simulator, single-step through the program and examine the data transfer and registers.
After data has been transferred from ROM space into RAM, Write down a subroutine that copy
the data from RAM locations starting at 40H to RAM locations starting at 60H.
ACTIVITY 2
Store five different sets of data in RAM locations 40H-44h and 60H-64H. Write an
assembly language Program that will exchange the data between the above two memory
locations.
Note: Use indirect addressing mode and DJNZ.

ACTIVITY 3
Store five arrays of data in RAM locations 40H-44h. Write an assembly language
Program to find out the largest of the stored data and display the results in port2.
Note: SUBB :- Instruction used for subtraction of two no.s in 8051.

ACTIVITY 4
Store five arrays of data in RAM locations 40H-44h. Write an assembly language
Program to sort the data in Ascending order.

ACTIVITY 5
Write a program to calculate y where y = x2 + 2x + 9. x is between 0 and 9 and the look-
up table for x2 is located at the address (code space) of 200H. Register R0 has the x, and at the
end of the program R2 should have y. Use the simulator to change the x value and single-step
through the program, examining the registers as you go.
LAB 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy