English
Language : 

UPSD33XX Datasheet, PDF (38/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic
uPSD33xx
Data Pointer Mode Register, DPTM (86h)
The two “background” data pointers, DPTR0 and
DPTR1, can be configured to automatically incre-
ment, decrement, or stay the same after a MOVX
instruction accesses the DPTR Register. Only the
currently selected pointer will be affected by the in-
crement or decrement. This feature is controlled
by the DPTM Register defined in Table 14.
The automatic increment or decrement function is
effective only for the MOVX instruction, and not
MOVC or any other instruction that uses the DTPR
Register.
Firmware Example. The 8051 assembly code il-
lustrated in Table 15 shows how to transfer a block
of data bytes from one XDATA address region to
another XDATA address region. Auto-address in-
crementing and auto-pointer toggling will be used.
Table 14. DPTM: Data Pointer Mode Register (SFR 86h, reset value 00h)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
–
–
–
–
MD11
MD10
Details
Bit
Symbol
R/W
Definition
7-4
–
–
Reserved
DPTR1 Mode Bits
3-2
MD[11:10]
R,W
00: DPTR1 No Change
01: Reserved
10: Auto Increment
11: Auto Decrement
DPTR0 Mode Bits
1-0
MD[01:00]
R,W
00: DPTR0 No Change
01: Reserved
10: Auto Increment
11: Auto Decrement
Bit 1
MD01
Bit 0
MD00
Table 15. 8051 Assembly Code Example
MOV
R7, #COUNT
; initialize size of data block to transfer
MOV
DPTR, #SOURCE_ADDR ; load XDATA source address base into DPTR0
MOV
85h, #01h
; load DPTC to access DPTR1 pointer
MOV
DPTR, #DEST_ADDR
; load XDATA destination address base into DPTR1
MOV
85h, #40h
; load DPTC to access DPTR0 pointer and auto toggle
MOV
86h, #0Ah
; load DPTM to auto-increment both pointers
LOOP:
MOVX(1)
A, @DPTR
; load XDATA byte from source into ACC.
; after load completes, DPTR0 increments and DPTR
; switches DPTR1
MOVX(1)
@DPTR, A
; store XDATA byte from ACC to destination.
; after store completes, DPTR1 increments and DPTR
; switches to DPTR0
DJNZ(1)
R7, LOOP
; continue until done
MOV
86h, #00
; disable auto-increment
MOV
85h, #00
; disable auto-toggle, now back to single DPTR mode
Note: 1. The code loop where the data transfer takes place is only 3 lines of code.
38/231