Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!tcdcs!swift.cs.tcd.ie!vax1.tcd.ie!smcgerty From: smcgerty@vax1.tcd.ie Newsgroups: comp.sys.amiga.programmer Subject: New life for MOVEM! Message-ID: <1991Feb11.160212.7749@vax1.tcd.ie> Date: 11 Feb 91 16:02:12 GMT Organization: Trinity College Dublin Lines: 41 Hi 68000 users! Here's a little trick that someone might find useful: (maybe its common knowlage?) Right, picture the problem; you want to move, say, 1200 bytes from A to B QUICKLY but you couldn't be bothered getting the Blitter to do it/Blitter is busy/You just don't know how to get the blitter to do it. So you do it like this LEA Source,A0 LEA Dest,A1 MOVE.W #300,D0 ; 1200 Bs=300 LWs Loop: MOVE.L (A0)+,(A1)+ DBRA D0,Loop How about this, which takes about 2/3 of the time of the above: LEA Source,A0 LEA Dest,A1 MOVE.W #25,D0 ;25*48=1200 bytes Loop: MOVEM.L (A0)+,D1-D7/A2-A6 ;12 LWs! = 48 bytes MOVEM.L D1-D7/A2-A6,(A1) ADDA.L #48,A1 ;since MOVEM can't have (A1)+ as Dest. operand DBRA D0,Loop Ok, so its a little register intensive, but you can always save all the regs before using the routine, and restore them later. Just to get a bit more speed, you could have a bigger loop, which has, say, five itterations of the original loop in one loop, which saves you 4 DBRA instructions for every 5-itteration. (I think thats almost 40 clock cycles!) You may think thats trivial, but it all mounts up! Anyone got any other tricks? ---------------------------------------------------------------------------- | / T | / Stephen John McGerty | Amiga // | | / | |/ smcgerty@vax1.tcd.ie (C.Sci.) | "Hmm.. No, nothing." \\// | |__________________________________________|_______________________________|