delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/28/17:01:07

From: shade AT atrey DOT karlin DOT mff DOT cuni DOT cz (Ondrej Sury)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: asm opcode speeds
Date: 28 Oct 1996 12:49:54 GMT
Organization: L.O.G.
Lines: 36
Distribution: world
Message-ID: <552a5i$rur$1@ns.felk.cvut.cz>
References: <5523m3$ss5 AT the-fly DOT zip DOT com DOT au>
NNTP-Posting-Host: atrey.karlin.mff.cuni.cz
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Dean (deanh AT zip DOT com DOT au) wrote:
> void plot_pixel( int x, int y, unsigned char colour, short where ) {
>   __asm__ ("
>     movw %3, %%es\n
>     movl $0xA0000, %%edi\n
Instead of this:
-------------------------
>     movw %1, %%di\n
>     movw %%di, %%ax\n
>     shl $8, %%di\n
>     shl $6, %%ax\n
-------------------------
try this:
      movw   %1, %%ax\n
      xchg %%ax\n /* Same as shl $8, %%ax */
      movw %%ax, %%di\n /* Now we have y << 8 in di */
      shr    $2, %%ax\n /* And this is same as shl $6, %%ax */
>     addw %%ax, %%di\n
>     addw %0, %%di\n
>     movb %2, %%al\n
>     stosb"
>     :
>     : "g" (x), "g" (y), "g" (colour), "g" (where)
>   );
> }
> 

  I suggest you download PCGPE from site x2ftp.oulu.fi, directory 
pub/msdos/programming/gpe. I think there are OpCodes with speeds.

-- 
-------------------------------------------------------------------------------
Blessed be,							Moon Shade.
		    An ye harm none, do what ye will.
			   Hope never dies.
-------------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019