![Dallas DS87C550 User Manual Supplement Download Page 68](http://html1.mh-extra.com/html/dallas/ds87c550/ds87c550_user-manual-supplement_3298646068.webp)
DS87C550 High-Speed Microcontroller User’s Guide Supplement
68 of 93
INC
DPTR
MOV
DPTR, #data16
MOVC
A, @A+DPTR
MOVX
A, @DPTR
MOVX
@DPTR, A
This feature allows further reduction of code for data movement operations, and therefore even higher
performance. The following example demonstrates the improved efficiency.
64 BYTE BLOCK MOVE WITH AUTO SELECT
; SH and SL are high and low bytes of the source address
; DH and DL are high and low bytes of the destination address
; DPS is the data pointer select bit. Reset condition is DPS = 0 (DPTR selected).
;
# of cycles
MOV
R5, #64
; Number of bytes to move
3
MOV
DPTR, #SHSL
; Load destination address & toggle select bit
2
MOV
DPTR, #DHDL
; Load destination address & toggle select bit
2
;
; This loop is executed the number of times contained in R5 (i.e., 64)
MOVE:
MOVX A, DPTR
; Read source data byte & toggle select bit
2
MOVX @DPTR, A
; Store at destination & toggle select bit
2
INC
DPTR
; Increment source address & toggle select bit
3
INC
DPTR
; Increment destination address & toggle select bit
3
DJNZ R5, MOVE
; Finished with table
3
Total = 7 + (13*64) = 839
64 BYTE BLOCK MOVE WITHOUT AUTO SELECT
; SH and SL are high and low bytes of the source address
; DH and DL are high and low bytes of the destination address
; DPS is the data pointer select bit. Reset condition is DPS = 0 (DPTR selected).
;
# of cycles
MOV
R5, #64
; Number of bytes to move
3
MOV
DPTR, #SHSL
; Load source address
2
INC
DPS
; Change active DPTR
2
MOV
DPTR, #DHDL
; Load destination address
2
INC
DPS
; Change active DPTR
2
;
; This loop is executed the number of times contained in R5 (i.e., 64)
MOVE:
MOVX
A, DPTR
; Read source data byte
2
INC
DPS
; Change active DPTR
2
MOVX
@DPTR, A
; Store at destination
2
INC
DPTR
; Increment destination address
3
INC
DPS
; Change active DPTR
2
INC
DPTR
; Increment destination address
3
INC
DPS
; Change active DPTR
2