Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #348

Re: Fastest method to copy/process a range of bytes?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From aiiadict@gmail.com
Newsgroups comp.sys.apple2.programmer
Subject Re: Fastest method to copy/process a range of bytes?
Date Tue, 7 Aug 2012 22:07:34 -0700 (PDT)
Organization http://groups.google.com
Lines 47
Message-ID <0caa25b9-9dfc-48bc-8a69-bb6aa76f0060@googlegroups.com> (permalink)
References <jvs69d$qa1$1@news.xmission.com>
NNTP-Posting-Host 108.230.94.47
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1344403970 9082 127.0.0.1 (8 Aug 2012 05:32:50 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 8 Aug 2012 05:32:50 +0000 (UTC)
In-Reply-To <jvs69d$qa1$1@news.xmission.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=108.230.94.47; posting-account=5kmk9wkAAAB22-WWGK8UTn8vQ5c3EvdQ
User-Agent G2/1.0
X-Received-Bytes 2865
Xref csiph.com comp.sys.apple2.programmer:348

Show key headers only | View raw


On Tuesday, August 7, 2012 3:53:32 PM UTC-7, datajerk wrote:

> 
> Assume length, ptr, and ptr_mp have already be set.
>

I looked at it and didn't see any ways to speed it up
(I'm not claiming any expertise)...

You might want to look at the auxmove routine?  should
be tight, fast code.  Also, prodos source code would be
good to look at for tight loops to move pages and partial
pages of memory.


length  dfw 0000 ;define 16bit word, length (of data to move)
ptr     equ $00 ;16 bit pointer to origin
ptr_mp  equ $02 ;16 bit pointer to destination

copy_mp:
         ldy     #0              ; init block counter
         ldx     length+1        ; do full blocks first,
                                 ;so get the hibyte of length
                                ; which is # of full blocks
         beq     copy_mp1        ; if 0, no full blocks
:
         lda     (ptr),y         ; load from origin
         sta     (ptr_mp),y      ; store to destination
         iny                     ; next y
         bne     :-              ; still in block? go again
         inc     ptr+1           ; next block of 256 (increment hibytes)
         inc     ptr_mp+1        ; next block of 256
         dex                     ; x contains LENGTH, # of full blocks
         bne     :-              ;if more blocks back to :


copy_mp1:                        ;y contains zero at this point
         ldx     length          ; remainder of array
         beq     copy_mp2        ; no remainder 
:                               ; same as before, Y should be 0
         lda     (ptr),y         ; load it
         sta     (ptr_mp),y      ; store it
         iny                     ; count up address
         dex                     ; count down length of array
         bne     :-              ; back to :
copy_mp2:
         rts 

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Fastest method to copy/process a range of bytes? Egan Ford <datajerk@gmail.com> - 2012-08-07 16:53 -0600
  Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-07 18:57 -0700
    Re: Fastest method to copy/process a range of bytes? Daniel Kruszyna <dan@krue.net> - 2012-08-08 15:28 +0000
  Re: Fastest method to copy/process a range of bytes? aiiadict@gmail.com - 2012-08-07 22:07 -0700
  Re: Fastest method to copy/process a range of bytes? "Michael J. Mahon" <mjmahon@aol.com> - 2012-08-08 10:49 -0700
    Re: Fastest method to copy/process a range of bytes? "Michael J. Mahon" <mjmahon@aol.com> - 2012-08-08 10:59 -0700
  Re: Fastest method to copy/process a range of bytes? "Anton Treuenfels" <teamtempest@yahoo.com> - 2012-08-08 21:27 -0500
    Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-08 22:12 -0700
      Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-08 22:23 -0700
        Re: Fastest method to copy/process a range of bytes? "Anton Treuenfels" <teamtempest@yahoo.com> - 2012-08-09 18:35 -0500
          Re: Fastest method to copy/process a range of bytes? Jerry <awanderin@yahoo.ca> - 2012-08-11 01:03 -0600
            Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-11 11:33 -0700
    Re: Fastest method to copy/process a range of bytes?  mmphosis <mmphosis@macgui.com> - 2012-08-09 06:09 +0000
      Re: Fastest method to copy/process a range of bytes?  mmphosis <mmphosis@macgui.com> - 2012-08-09 09:40 +0000
      Re: Fastest method to copy/process a range of bytes? "Anton Treuenfels" <teamtempest@yahoo.com> - 2012-08-09 18:54 -0500
        Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-09 17:48 -0700
        Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-09 17:46 -0700
          Re: Fastest method to copy/process a range of bytes? Michael J. Mahon <mjmahon@aol.com> - 2012-08-10 15:25 -0500
            Re: Fastest method to copy/process a range of bytes? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-10 14:23 -0700
    Re: Fastest method to copy/process a range of bytes? Egan Ford <datajerk@gmail.com> - 2012-08-12 08:56 -0600
      Re: Fastest method to copy/process a range of bytes? "Anton Treuenfels" <teamtempest@yahoo.com> - 2012-08-12 23:27 -0500
        Re: Fastest method to copy/process a range of bytes? Egan Ford <datajerk@gmail.com> - 2012-08-13 11:18 -0600
  Re: Fastest method to copy/process a range of bytes? Egan Ford <datajerk@gmail.com> - 2012-08-11 15:58 -0600
    Re: Fastest method to copy/process a range of bytes? Egan Ford <datajerk@gmail.com> - 2012-08-11 16:16 -0600

csiph-web