Instructions for Data Transfer between internal RAM

By



The data between internal RAM location or SFR, are called internal data moves. These are possible by writing move instruction in different addressing modes.
·         Using an immediate addressing mode:-
   1] MOV A, #data              
Ÿ Description: Move an immediate data in accumulator. The immediate data in this instruction                                                   is always an eight bit.
     Ÿ Operation   :Move
                             Aß A, # data
     ŸExample      :MOV A, #32H
    Move data 32h into accumulator.
2] MOV Rn, #data
       Ÿ Description     :  Move an immediate data in any register (R0……..R7).
                                    The immediate data in this instruction is always an eight bit.
       Ÿ Operation        : Move
                                    Rnß#data
       ŸExample           : MOV R2, #50H
                                   Move data 50H into register R2.
   3] MOV direct, #data        
       Ÿ Description    : 8-dit immediate data in copied into internal RAM location whose address is specified directly in to instruction. The destination can be SFR also.
       Ÿ Operation      : MOV
                                  (direct address)ß#data
       Ÿ Example        : MOV 30H, #9AH
                                  The internal RAM location 30H is loaded with data 9AH.
                                  MOV 02H, #50H
                                  The internal RAM location 02H (Register R2 of Bank 0) is loaded with data 50H.
  4] MOV @ Rp, #data
       Ÿ Description   : An immediate data moved to a location whose address is specified by Rp only
                                   Registers R0 o r1 are used as indirect mode of operation.
       Ÿ Operation     : MOV
                                  [(Rp)]ß#data
       Ÿ Example       : Suppose R0 contains 7FH
                                      MOV @R0, #36h
                                  Data 36H is copied to location whose address is specified by R0 i.e. after executing this    
                                  instruction, internal RAM location 7FH is loaded with data 36H.
·         Using register –addressing mode:-
                          6] MOV A, Rn
Ÿ Description         : Move the con
                                 AßRn
Ÿ Example              : Move A, R2: Move contacts of R2 into accumulator the of R2 remain as it is .This    
                                  means  contacts of destination always change after data teamster instruction is  
                                  executed.
7] MOV Rn, A
 Ÿ Description:          Move the contact of accumulator into register. Rn presents register from R0 to R7.
 Ÿ Operation           : MOV
         RnßA
 Ÿ Example             :Move R5, A: Move contact of accumulator into R5.
       The contacts of Rs change after execution but contacts of accumulator remain as it is.
·         Using direct addressing Mode:-
8] Move A, direct
Ÿ  Description             : the content of memory location (internal Ram or SFR) Specified by direct address is
                                moved into accumulator.
Ÿ  Operation              : MOV
                                     A ß(direct address)
Ÿ  Example            : Move A, 40H.
                                   The contacts of memory location 40H are moved into accumulator. If a content of 40H is
                                5AH, then after execution of this instruction accumulator has 5AH
9] MOV direct, A
 Ÿ Description    : The content of accumulator to the specified memory location specified by direct    
                            address.
 Ÿ Operation       : MOV
                            (Direct address)ßA
Ÿ Example        : Move 90H, A, the content of accumulator is moved to port 1(address of part 1 is 90H).If    
                           content of accumulator is 7FH then after execution of this instruction part 1 has 7FH.
 10] MOV Rn,direct.
Ÿ  Description   : Move the contect of memory location specified by direct address into register
                              R0 to R7.
Ÿ  Opreation      : Mov
Ÿ                          Rn   ß (direct address)
Ÿ  Example      : MOV R5,80H         ; 80H is address of port 0. Move contacts of port 0 into R5.  
                            MOV R3,47H         ;47H address of internal RAM location. Move the contents
                                                           of memory location 47H into R3.
11] MOV direct , Rn.
·         Description    : Move the contect of register Rn [R0……R7] into memory location specified   
                         by direct address.
·         Operation       : Mov
       [direct address]    ß  Rn.
·         Example         : Mov 20H,R7
      Move contents of R7 into memory location 20H.
      Mov 03H,R7
      Move contents of R7 into R3.
      (Memory location 03H is the address of register R3).
12] MOV direct , direct.
·         Description     : Move the contect of internal RAM or SFR into another RAM location or
                          SFR.
·         Operation        : Mov
                   (direct address)     ß      (direct address).
·         Example         : MOV 20H , 07H
        Move contects of register R7 into memory location 20H.
        (memory location 07H is the address of register R7).
        MOV 03H , 07H
        MOV contents of R7 into R3.

·         Using  The  Indirect  Addressing  Mode:-
13] Mov A,@Rp.
·         Description  : Move the contect of memory location specified by Rp to accumulator.Only
                       register R0 or R1 are used as indirect mode of operation.
·         Operation     : Mov
         A    ß     [(Rp)]
·         Example      : Suppose R0 contains 75H and RAM location 7FH contain data 25H,then
                     after executing this instruction.
                     MOV A,@R0
                Accumulator is loaded with data 25H.
14] Mov @ Rp,A.
·         Description  : Move the contents of accumulator into the memory location specified by
                       Rp.
·         Operation     : Mov
                      [(Rp)]   ß   A
·         Example:      Suppose accumulator contains 50H and R0 contains 70H.
                     Then after executing this instruction Mov @ R0 , A.
                     Internal RAM location 70h is loaded specified by rp into50H.
15] Mov direct ,@ Rp
·         Description   : Move the contents of memory location specified by Rp into direct memory
                       location.
·         Operation     : Mov
·         Example       : Suppose R0 contains 70H contains 55H.then after executing this
                      instruction
                      Mov 90H ,@R0 ;    90H is  Address at port 1
                      Port 1 is loaded with data 50H
                   This instruction performs similar operation like Mov P1 , @R0.
16] Mov @ Rp , direct
·         Description  : Move the contents of direct memory location into the memory location
·                               specified by Rp.
·         Operetion    : Mov
                     [(Rp)]    ß        (direct address)
·         Example     : Suppose port 1 contains 50H and R0 contains 70H,then after executing this
                     instruction
                    Mov @ R0,90H ;     90His address of port 1
                     Internal RAM location 70H is loaded with data 50H.

0 comments:

Post a Comment

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