Mail Archives: djgpp/1996/05/31/02:04:29
In article <4nqp27$8uu AT waldorf DOT csc DOT calpoly DOT edu>,
Jan Louwerens <jlouwere AT galaxy DOT csc DOT calpoly DOT edu> wrote:
>of the loop, as well as the (4*i) and the add. Why not just make an inline
>assembler function to do it. That seems fastest to me. Something like:
>
> mov esi, (pointer to Virtual Screen)
> mov edi, (pointer ~csc/sample/ada/to VGA Memory)
> mov ecx, 16000 (320*200 / 4 (for ~csc/sample/ada/dwords))
> rep
> movsl
>
>(This code may not be exactly correct, but it gets the idea across)
You'll get pretty much exactly this if you do:
memcpy((pointer to Virtual Screen), (pointer to VGA memory), 64000);
with optimization turned on. Trust me.
As for speed, you can sometimes beat a rep;movsl on P5 and up, but only
on some memory subsystems (Overlapping pushes/pops, check comp.lang.asm.x86).
For general purpose code, this is the fastest you're likely to get.
--Brennan
--
brennan AT rt66 DOT com | "Barney vs. Mentos II: Unholy Alliance." Coming Soon.
- Raw text -