English
Language : 

UPSD3354DV-40U6 Datasheet, PDF (58/272 Pages) STMicroelectronics – fast 8032 MCU with programmable logic
Dual data pointers
UPSD33xx
Table 17. 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
LOOP:
MOV
MOVX(1)
86h, #0Ah
A, @DPTR
; load DPTM to auto-increment both pointers
; load XDATA byte from source into ACC.
; after load completes, DPTR0 increments and
DPTR
MOVX(1) @DPTR, A
; switches DPTR1
; store XDATA byte from ACC to destination.
; after store completes, DPTR1 increments and
t(s) DJNZ(1)
MOV
duc MOV
R7, LOOP
86h, #00
85h, #00
DPTR
; switches to DPTR0
; continue until done
; disable auto-increment
; disable auto-toggle, now back to single DPTR
mode
Obsolete Product(s) - Obsolete Pro 1. The code loop where the data transfer takes place is only 3 lines of code.
58/272
Doc ID 9685 Rev 7