delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/22/17:16:43

From: vcarlos35 AT juno DOT com
To: djgpp AT delorie DOT com
Date: Tue, 22 Jun 1999 17:18:23 -0400
Subject: Re: Why dosn't my asm getpixel() work?
Message-ID: <19990622.171823.-601273.0.vcarlos35@juno.com>
X-Mailer: Juno 2.0.11
X-Juno-Line-Breaks: 0-1,3-35
X-Juno-Att: 0
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com


On Tue, 22 Jun 1999 09:38:09 -0400 "Campbell, Rolf [SKY:1U32:EXCH]"
<cp1v45 AT americasm01 DOT nt DOT com> writes:
>Gathers wrote:
>
>> >6. The multiply can be optimized better; this is left as an 
>exercise for
>> >the reader.
>> >
>> mov ax,y
>> mov bx,ax
>> shl ax,8
>> shl bx,6
>> add ax,bx
>> ax==y*320?
>
>    On pre-Pentium machines it is 1 cycle faster to use, on post-486
>machines it is 1 cycle slower to use:
>mov bh, bl
>xor bl, bl
>
>instead of
>shl bx, 6
>
>PS:  This is not AT&T style assembler, so it won't work with DJGPP.
>


Put value to be multiplied by in eax
lea  eax,[eax+eax*4]
shl  eax, 6

The lea instruction can multiply by five :-)
Although on a K6, I would just use the mul instruction (just 2 clocks)


___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.

- Raw text -


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