Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/27/00 19:20
Read: times


 
#3439 - RE: Fast xram copy
Yes there is a faster way, you can spare 1 cycle in a loop:

clr a
mov dpl,a
mov r2,a
mov r0,a


L1:
movx a,@dptr (2 cycles)
movx @r0,a (2 cycles)
inc r0 (1 cycle)
inc dpl (1 cycle)
djnz r2,L1 (2 cycles)

ret

your loop takes 8 cycles, but you can do it in another way:

L1:
movx a,@dptr (2 cycles)
movx @r0,a (2 cycles)
dec dlp (1 cycle)
djnz r0,L1 (2 cycles)

ret

You can test in, works perfectly OK.
This solution gives you 12.5% time save.
If you need a faster solution, take a device with dual data pointers and fast data move option (like some DALLAS devices have).

Franc


List of 6 messages in thread
TopicAuthorDate
Fast xram copy            01/01/70 00:00      
RE: Fast xram copy            01/01/70 00:00      
RE: Fast xram copy            01/01/70 00:00      
RE: Fast xram copy            01/01/70 00:00      
Move Pointers, Not Data            01/01/70 00:00      
RE: Move Pointers, Not Data            01/01/70 00:00      

Back to Subject List