Microcontrollers Lab Manual 06ESL47
1. DATA TRANSFER INSTRUCTIONS
1.Write A Program to move a block of data within the internal RAM
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
Transfer accumulator content to the destination location.4.Decrement the count register
Update data pointers.
Check whether all the bytes are transferred or not. ie, if count is notzero repeat step 2 through 6.
ORG 0HSTART1:MOV R0,#40H;
R0 POINTED TO INTERNAL RAM 40H
R1 POINTING TO INTERNAL RAM 030H
R2 LOADED WITH NO. OF ELEMENTS IN `;THE ARRAY
START: MOV A,@R0
MOV @R1,AINC R0INC R1DJNZ R2,START
;DECREMENT R2,IF NOT EQUAL TO ;0,CONTINUE WITH DATA;TRANSFER PROCESS.
HERE: SJMP HEREEND
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