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

1. a) Write an assembly language program (ALP) to move the data from one register to another.

ORG 0000H

LJMP MAIN

MAIN: MOV R0, #25H

MOV R1,@R0

END

1. b) Write an ALP to move the data from internal RAM one location to another.
2. a) Write an ALP to move the data from external RAM one location to another.

2 b) Write an ALP to move the data from external RAM internal RAM and vice versa.

ORG 0000H

MOV R1,#05 ;Counter

MOV R0,#30H ;Source

MOV DPTR,#2000H ;Destination

back:MOV A,@R0

MOVX @DPTR,A ;A->ext destn

INC R0 ;Source increment

INC DPTR ;destination increment

DJNZ R1,back

END
3. a) Write an ALP to exchange the data between two registers.

MOV R0,#20H
MOV R1,#30H
MOV R2,#0AH
UP:MOV A,@R0
XCH A,@R1
MOV @R0,A
INC R0
INC R1
DJNZ R2,UP
RET

3 b) Write an ALP to exchange the data between two internal RAM locations.

You might also like