Path: utzoo!dciem!nrcaer!scs!spl1!lll-winken!lll-tis!ames!necntc!ima!think!ephraim From: ephraim@think.COM (ephraim vishniac) Newsgroups: comp.sys.mac.programmer Subject: Re: BlockMove efficiency Message-ID: <21737@think.UUCP> Date: 7 Jun 88 13:39:28 GMT Article-I.D.: think.21737 References: <7212@watdragon.waterloo.edu> <8796@dartvax.Dartmouth.EDU> Sender: usenet@think.UUCP Reply-To: ephraim@vidar.think.com.UUCP (ephraim vishniac) Distribution: comp Organization: Thinking Machines Corporation, Cambridge, MA Lines: 29 In article <8796@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu (Earle R. Horton) writes: >BlockMove isn't bad for general purpose use, and I probably couldn't >do better. For specific cases, however, there is certainly room for >speed improvement. BlockMove uses "move.b" for all moves, and strings >a few of them together to gain a speed increase over a loop. If you >are moving WORDs (integers, shorts, what have you) then you can move >them much faster using "move.w" or "move.l". If you are moving >LONGINTs, then you can move them a lot faster on a Mac II if they are >aligned properly and you use "move.l." Earle, the last time I disassembled _BlockMove (back in 64K ROM days), the description you give above was wrong. Unless someone at Apple has completely lost his mind, I expect it's still wrong. BlockMove checks on the relative alignment of the source and destination. When possible, it does bulk moves by saving off most of the registers, then doing large MOVEM.L's to read/write as much data as possible at each pass. I seem to recall a four-instruction loop: one to read from memory to registers; one to write from registers to memory; one to fix up an address pointer because MOVEM has limited choice of pre/post increment/decrement; and a dbra for loop control. What's the source of your claim? Ephraim Vishniac ephraim@think.com Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142-1214 On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?"