Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.programmer Subject: Re: How to swap chip data?? Message-ID: Date: 8 May 91 20:38:26 GMT References: <1991May6.100837.24590@wehi.dn.mu.oz> Organization: Not an Organization Lines: 52 In article jay@deepthot.cary.nc.us (Jay Denebeim) writes: >In article <1991May6.100837.24590@wehi.dn.mu.oz> baxter_a@wehi.dn.mu.oz writes: >>What is the best (quickest and least wasteful of memory) for swapping >>chip data in and out of memory? >>.. >Well, it sounds like you're copying a bunch of stuff. In this case >(I don't know exactly how many bytes is break even) I would probably >use the CopyMem(?) function in the KickStart. > >SAS's memcpy ALWAYS uses byte copies. The one in the kickstart is >smart, it figures out alignments and bus size of the processor and >copies it using the biggest chunks of memory it can. > >On a 68K the fastest copy I can think of would be something along >the lines of: > push a bunch of registers > init looping vars > movem(ultiple) into cpu Which is exactly what CopyMem() and CopyMemQuick() do. But, BEWARE, CopyMem[Quick]() does NOT handle overlapping source and destination. As long as your source & destination are not overlapping, it's the quickest way to copy a block of memory. CopyMem() will deal with arbitrary data lengths and alignments, by the way. >To sum up, I would probably use the call to the KS function for this. >Its more portable, and should be quite fast. > >> >>Regards Alan > >-- > > |_o_o|\\ > |. o.| || The Jay Denebeim > | . | || Software > | o | || Distillery > | |// Address: UUCP: mcnc.org!deepthot.uucp!jay > ====== Internet: jay@deepthot.cary.nc.us > BBS:(919)-460-7430 VOICE:(919)-460-6934 -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA