Exp1-Data Transfer or Exchange Between Specified Memory Locations

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Exp1-Data transfer or exchange between specified memory

locations

1.1 Data Transfer to a specified memory locations

Aim:
..............................................................................................................................................
Algorithm:

Step1:...........................................
Step2:...........................................
............................................
Program

ORG 00h

mov R0,#30h//source address

mov R1,#40h//destination address

mov R7,#05h//Number of bytes to be moved

back: mov A,@R0

mov @R1,A

inc R0

inc R1

djnz R7,back//repeat till all data transferred

END //end

Result

1.2 Data Exchange between specified memory locations

Aim:
..............................................................................................................................................
Algorithm:

Step1:...........................................
Step2:...........................................
............................................
Program

ORG 00h

mov R0,#30h//source address

mov R1,#40h//destination address

mov R7,#05h//Number of bytes to be moved

back: mov A,@R0

xch A,@R1

MOV @R0,A

inc R0

inc R1

djnz R7,back//repeat till all data transferred

END //end

Result:

You might also like