Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
34Activity
0 of .
Results for:
No results containing your search query
P. 1
8051 Manual Fin

8051 Manual Fin

Ratings: (0)|Views: 1,756 |Likes:
Published by nagaraj

More info:

Published by: nagaraj on Mar 09, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

04/08/2013

pdf

text

original

 
Microcontrollers Lab Manual 06ESL47
KVG COLLEGE OF ENGINEERING
Electronics and Communications
MicroControllerLab Manual
Dept. Of E & C Engg KVGCE,Sullia
 
Microcontrollers Lab Manual 06ESL47
1. DATA TRANSFER INSTRUCTIONS
1.Write A Program to move a block of data within the internal RAM
 
Algorithm
1.Initialize registers to holda.the count, the number of data bytes to be moved,b.the starting addresses of source blockc.starting addresses of destination block.2.Get data from source location into accumulato
3.
Transfer accumulator content to the destination location.4.Decrement the count registe
5.
Update data pointers.
6.
Check whether all the bytes are transferred or not. ie, if count is notzero repeat step 2 through 6.
PROGRAM CODE:
 ORG 0HSTART1:MOV R0,#40H;
R0 POINTED TO INTERNAL RAM 40H
MOV R1,#30H;
R1 POINTING TO INTERNAL RAM 030H
MOV R2,#5;
R2 LOADED WITH NO. OF ELEMENTS IN `;THE ARRAY
START: MOV A,@R0
;DATA TRANSFER
MOV @R1,AINC R0INC R1DJNZ R2,START
;DECREMENT R2,IF NOT EQUAL TO ;0,CONTINUE WITH DATA;TRANSFER PROCESS.
HERE: SJMP HEREEND
RESULT:
Before Execution: Fill 5 locations at I:0040h with data bytes.5 locations at I:0030h are blank.After Execution: 5 locations I:0040h are filled up with data. These are copiedto 5 locations at I:0030h .
Dept. Of E & C Engg KVGCE,Sullia
 
Microcontrollers Lab Manual 06ESL47
2) Write an assembly language program to transfer n =10 bytes of datafrom location 8035h to location 8041h within External RAM.(withoutoverlap). Write the code at C:030h
Algorithm
1. Initialize registers to holda.the count, the number of data bytes to be moved,b.the starting addresses of source blockc.starting addresses of destination block.2.Get data from source location into accumulator and transfer to thedestination location.3.Update data pointers.
4.
Decrement the count register, repeat step 2-3 if count is not zero.
PROGRAM CODE:
 
ORG 0000HSJMP 30HORG 30HMOV DPH,#80H ; source/Desti address Higher order ByteMOV R0,#35H ;//source address Low ByteMOV R1,#41H ;//destination address Low ByteMOV R3,#0AH ;//countBACK:MOV DPL, R0MOVX A,@DPTRMOV DPL, R1MOVX @DPTR,AINC R0INC R1DJNZ R3, BACKHERE: SJMP HEREEND
RESULT:
Before Execution: 10 locations at X:8035h are to be filled up with data.After Execution: 10 locations at X:8041h are filled up with data from 8035h.
Dept. Of E & C Engg KVGCE,Sullia

Activity (34)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
hksaifee liked this
Nitin Niitn liked this
Nitin Niitn liked this
Krishna Mohan liked this
Eng Lamezoon liked this
Ronak Manani liked this
Sagar Diwane liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->