English
Language : 

W77C32_07 Datasheet, PDF (37/78 Pages) Winbond – 8-BIT MICROCONTROLLER
W77C32/W77C032A
MOV R2, #CNT
MOV R3, #SL
MOV R4, #SH
MOV R5, #DL
MOV R6, #DH
Machine Cycles of W77C032
#
; Load R2 with the count value
2
; Save low byte of Source Address in R3
2
; Save high byte of Source address in R4
2
; Save low byte of Destination Address in R5
2
; Save high byte of Destination address in R6
2
LOOP:
MOV DPL, R3
; Load DPL with low byte of Source address
2
MOV DPH, R4
; Load DPH with high byte of Source address
2
MOVX A, @DPTR
; Get byte from Source to Accumulator
2
INC DPTR
; Increment Source Address to next byte
2
MOV R3, DPL
; Save low byte of Source address in R3
2
MOV R4, DPH
; Save high byte of Source Address in R4
2
MOV DPL, R5
; Load low byte of Destination Address in DPL
2
MOV DPH, R6
; Load high byte of Destination Address in DPH
2
MOVX @DPTR, A
; Write data to destination
2
INC DPTR
; Increment Destination Address
2
MOV DPL, R5
; Save low byte of new destination address in R5
2
MOV DPH, R6
; Save high byte of new destination address in R6
2
DJNZ R2, LOOP
; Decrement count and do LOOP again if count <> 0 2
Machine cycles in standard 8032 = 10 + (26 * CNT)
Machine cycles in W77C032 = 10 + (26 * CNT)
If CNT = 50
Clock cycles in standard 8032= ((10 + (26 *50)) * 12 = (10 + 1300) * 12 = 15720
Clock cycles in W77C032 = ((10 + (26 * 50)) * 4 = (10 + 1300) * 4 = 5240
Block Move with Two Data Pointers in W77C032:
; SH and SL are the high and low bytes of Source Address
; DH and DL are the high and low bytes of Destination Address
; CNT is the number of bytes to be moved
Machine Cycles of W77C032
#
MOV R2, #CNT
; Load R2 with the count value
2
MOV DPS, #00h
; Clear DPS to point to DPTR
2
MOV DPTR, #DHDL ; Load DPTR with Destination address
3
INC DPS
; Set DPS to point to DPTR1
2
MOV DPTR, #SHSL ; Load DPTR1 with Source address
3
LOOP:
MOVX
A, @DPTR ; Get data from Source block
2
INC DPTR
; Increment source address
2
DEC DPS
; Clear DPS to point to DPTR
2
MOVX
@DPTR, A ; Write data to Destination
2
INC DPTR
; Increment destination address
2
INC DPS
; Set DPS to point to DPTR1
2
DJNZ R2, LOOP
; Check if all done
3
- 37 -
Publication Release Date: February 1, 2007
Revision A8