
HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Handshake Solutions
© Philips Electronics N.V. 2005
Page 115 of 132
MOV DPTR,#data16
Function: Load Data Pointer with a 16-bit constant
Description: The Data Pointer is loaded with the 16-bit constant indicated. The 16-bit constant is loaded into
the second and third bytes of the instruction. The second byte (DPH) is the high-order byte, while
the third byte (DPL) holds the low-order byte. No flags are affected.
This is the only instruction which moves 16 bits of data at once.
Example: The instruction,
MOV DPTR,#1234H
will load the value 1234H into the Data Pointer: DPH will hold 12H and DPL will hold 34H.
Bytes: 3
Cycles: 2
Encoding:
Operation: MOV
(DPTR)
← (#data15-0)
DPH
□
DPL
← #data15-8
□
#data7-0
MOVC A,@A+<base-reg>
Function: Move Code byte
Description: The MOVC instructions load the Accumulator with a code byte, or constant from program mem-
ory. The address of the byte fetched is the sum of the original unsigned eight-bit Accumulator con-
tents and the contents of a sixteen-bit base register, which may be either the Data Pointer or the
PC. In the latter case, the PC is incremented to the address of the following instruction before be-
ing added with the Accumulator; otherwise the base register is not altered. Sixteen-bit addition is
performed so a carry-out from the low-order eight bits may propagate through higher-order bits.
No flags are affected.
Example: A value between 0 and 3 is in the Accumulator. The following instructions will translate the value
in the Accumulator to one of four values defined by the DB (define byte)
←irective:
REL_PC: INC A
MOVC A,@A+PC
RET
DB 66H
DB 77H
DB 88H
DB 99H
If the subroutine is called with the Accumulator equal to 01H, it will return with 77H in the Accumu-
lator. The INC A before the MOVC instruction is needed to “get around” the RET instruction above
the table. If several bytes of code separated the MOVC from the table, the corresponding number
would be added to the Accumulator instead.
1
0
0
1
0
0
0
0
imm. data 15-8
imm. data 7-0