9 Dual Data Pointer Register (DPTR)
The additional data pointer can be used to speed up code execution and reduce code size. The dual DPTR
structure is a way by which the chip will specify the address of an external data memory location. There are two
16-bit DPTR registers that address the external memory, and a single control bit called DPS (AUXR1.0) that
allows the program code to switch between the external memory.
Figure 9-1. Use of Dual DPTR
(83h)
DPH
(82h)
DPL
DPS=0
DPS=1
DPTR0
DPTR1
DPH
DPL
Selected by
External Data Memory
DPS
DPTR Instructions
The six instructions that refer to DPTR currently selected using the DPS bit are as follows:
INC DPTR
;Increments the data pointer by 1
MOV DPTR,#data16 ;Loads the DPTR with a 16-bit constant
MOVC A,@A+DPTR
MOVX A,@DPTR
MOVX @DPTR,A
JMP @A+DPTR
;Move code byte relative to DPTR to ACC
;Move external RAM (16-bit address) to ACC
;Move ACC to external RAM (16-bit address)
;Jump indirect relative to DPTR
AUXR1 (Address=8EH, Auxiliary Register1, Reset Value=0000,0000B)
7
6
5
4
3
2
1
0
P4KB
P4PCA
P4SPI
P4S2
GF2
-
-
DPS
DPS: DPTR select bit, used to switch between DPTR0 and DPTR1.
The DPS bit status should be saved by software when switching between DPTR0 and DPTR1.
DPS
0
1
DPTR selected
DPTR0
DPTR1
35
MPC82G516A Data Sheet
MEGAWIN