Mail Archives: djgpp/1999/06/22/17:16:43
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 -