Tuesday, 17 September 2013

To exchange contents of two memory location

        
        ORG 000H
        SJMP START
START : MOV R2,#05H /* R2 declared as a pass counter*/
        MOV R0,#30H
        MOV R1,#50H
   UP : MOV A,@R0
        MOV B,@R1
        MOV @R1,A
        MOV @R0,B
        INC R1
        INC R0
        DJNZ R2,UP

STOP  : SJMP STOP

No comments:

Post a Comment