Keil™, An ARM® Company

8051 Instruction Set Manual

MOV

The MOV instruction moves data bytes between the two specified operands. The byte specified by the second operand is copied to the location specified by the first operand. The source data byte is not affected.

See Also: MOVC, MOVX

MOV @Rn, #immediate
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
0111011nimmediate
Operation
MOV
(Rn) = immediate
Example
MOV @R0, #0
MOV @Ri, A
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
1111011i
Operation
MOV
(Ri) = A
Example
MOV @R0, A
MOV @Ri, direct
CACF0RS1RS0OV P
Bytes2
Cycles2
Encoding
1010011idirect
Operation
MOV
(Ri) = (direct)
Example
MOV @R1, P2
MOV A, #immediate
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
01110100immediate
Operation
MOV
A = immediate
Example
MOV A, #0FFh
MOV A, @Ri
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
1110011i
Operation
MOV
A = (Ri)
Example
MOV A, @R1
MOV A, direct
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
11100101direct
Operation
MOV
A = (direct)
Example
MOV A, P0
MOV A, Rn
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
11101nnn
Operation
MOV
A = Rn
Example
MOV A, R6
MOV bit, C
CACF0RS1RS0OV P
Bytes2
Cycles2
Encoding
10010010bit
Operation
MOV
(bit) = C
Example
MOV 22h, C
MOV C, bit
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
10100010bit
Operation
MOV
C = (bit)
Example
MOV C, 22h
MOV dest_direct, src_direct
CACF0RS1RS0OV P
Bytes3
Cycles2
Encoding
10000101src_directdest_direct
Operation
MOV
(dest_direct) = (src_direct)
Example
MOV P1, P0
MOV direct, #immediate
CACF0RS1RS0OV P
Bytes3
Cycles2
Encoding
01110101directimmediate
Operation
MOV
(direct) = immediate
Example
MOV P2, #0FFh
MOV direct, @Rn
CACF0RS1RS0OV P
Bytes2
Cycles2
Encoding
1000011ndirect
Operation
MOV
(direct) = (Rn)
Example
MOV P0, @R1
MOV direct, A
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
11110101direct
Operation
MOV
(direct) = A
Example
MOV P0, A
MOV direct, Rn
CACF0RS1RS0OV P
Bytes2
Cycles2
Encoding
10001nnndirect
Operation
MOV
(direct) = Rn
Example
MOV P2, R5
MOV DPTR, #immediate
CACF0RS1RS0OV P
Bytes3
Cycles2
Encoding
10010000immediate15-8immediate7-0
Operation
MOV
DPTR = immediate
Example
MOV DPTR, #1234h
MOV Rn, #immediate
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
01111nnnimmediate
Operation
MOV
Rn = immediate
Example
MOV R4, #0h
MOV Rn, A
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
11111nnn
Operation
MOV
Rn = A
Example
MOV R5, A
MOV Rn, direct
CACF0RS1RS0OV P
Bytes2
Cycles2
Encoding
10101nnndirect
Operation
MOV
Rn = (direct)
Example
MOV R4, P1