Unit 5-Data Transfer Instruction
Unit 5-Data Transfer Instruction
Instruction Set
Registers
Internal Memory
Example
Before Execution
After Execution
R3=50H ,A=50H
MOV A,direct
Copy the data from the addressed location (direct) to the
accumulator
Example
Mov A, 32H ; Copy the data from the internal memory
location 32H to Accumulator
Before Execution
Assume A=50H ,Memory Location 32H=60H
After Execution
A=60H , Memory Location 32H=60H
MOV A,@Ri
Copy the data to accumulator from the location specified in
Register Ri
Example
Mov A,@R0; Copy the data from the location specified by Ro to
Accumulator
Before Execution
Assume A=50H , R0=32H ,Memory Location 32H=60H
After Execution
A=60H , R0=32H ,Memory Location 32H=60H
MOV A,#data
Before Execution
After Execution
R3=60H , A=60H
MOV Rn,direct
Copy the data from the addressed location (direct) to the Register Rn
Example
Mov R0, 32H ; Copy the data from the internal memory location
32H to register R0
Before Execution
Assume A=50H ,Memory Location 32H=60H
After Execution
A=60H , Memory Location 32H=60H
MOV Rn,#data
Example
Mov DPTR, #4100H; Moves the data 4100H to the DPTR register
Before Execution
Assume DPTR=4000H
After Execution
DPTR=4100H
MOVC A,@A+DPTR
Copies the code byte relative to the DPTR
(address=A+DPTR) to the accumulator
Example
MOVC A,@A+DPTR
Before Execution
Assume A =30H, DPTR =1125H, A+DPTR=1155H (30H + 1125H),
Code memory 1155H= A5H
After Execution
A= A5H
MOVC A,@A+PC