8051 Instructions For Data Transfer Between External RAM

By


       

                                         8051 Instructions For Data Transfer Between External RAM



      

   The MOVX instruction is used when external memory is to be interfaced. This performs data transfer only between external memory and accumulator. In this instruction one side accumulator is compulsory. The MOVX instruction performed always in Indirect addressing mode.
·  








       From External Memory To Accumulator :
1] MOV X A,@Rp
·         Description     : Move the data stored in external memory (RAM) whose address is stored
                          in Rp (R0 or R1 can  Be used) into Accumulator.
·         Opretion        : MOV X
                       A  ß [(Rp)]ext
·         Example        : Max X A,@R1.
                       Suppose R1 contains 50H. so micro controller goes to address 50H from
                       external RAM and moves contens of it into accumulator.
2]Mov X A,@DPTR
·         Description   : Copy the contents of the external RAM location whose address is stored in
                        data pointer (DPTR)  Into accumulator.
·         Operation      : MOVX
                      A      ß   [(DPTR)]
·         Example        : MCVX A, @ DPTR))
                     Suppose DPTR contains 2050H, 50 microcontroller goes to external RAM
                    address 2050H and take a byte from there and moves it into accumulator.



·         From Accumulator To External Memory :-
3].MOV X @ Rp , A.
·         Description     : Move the contents of accumulator to the address shorted in Rp (only R0
                         or R1 used) to point external memory (RAM).
·         Operation      : Mov X
                        [(Rp)]ext     ß    A
·   Example        : suppose R1 point to 40H and accumulator contains 77H , then
                       microcontroller stores data 77H external RAM address 40H(Specified by R1).
4]. MOV X @DPTR , A
·   Description    : Copy the contents of accumulator into the external RAM location whose
                         address is stored in data pointer(DPTR).
·   Operation      : Mov,and        
                        [(DPTR)]     ß        A
·   Example         : Mov X @ DPTR,A
                        Suppose DPTR contains 2050H accumulatocontain77H,then   
                        microcontroller store data 77H to External RAM address 2050H.

0 comments:

Post a Comment

If you have any questions or droughts feel free to ask here.