Board index » delphi » 64Bit Multiplication - why doesn't this work?

64Bit Multiplication - why doesn't this work?

Quote
Mike Fee wrote:
> ... lots of things with inline assembly code example.

Why don't you simply use the built-in "comp" type?  It's 80
bit, if I remember correctly, and it's integer (although
it looks like a floating point type).

- Alf

 

Re:64Bit Multiplication - why doesn't this work?


Re:64Bit Multiplication - why doesn't this work?


Re:64Bit Multiplication - why doesn't this work?


Quote
Alf P. Steinbach wrote:

> Why don't you simply use the built-in "comp" type?  It's 80
> bit, if I remember correctly, and it's integer (although
> it looks like a floating point type).

Actually, it's more accurate to say "it's floating point, even though it
looks like an integer" - comp is a x87 datatype.

--

http://www.midnightbeach.com/jon   Personal Pages
http://www.midnightbeach.com/jon/pubs Programming Publications
http://www.midnightbeach.com/hs             Home School Resource List

Re:64Bit Multiplication - why doesn't this work?


In article <4rg225$...@kruuna.helsinki.fi>,

Quote
Osmo Ronkanen <ronka...@cc.helsinki.fi> wrote:

>What's wrong with following:

>        asm
>        db $66; mov ax, word ptr x
>        db $66; mul ax, word ptr y

That should naturally be ... mul word ptr y, the AX is implied.

Quote
>        db $66; mov word ptr zhi,dx
>        db $66; mov word ptr zlo,ax
>        end;

>Osmo

Osmo

Re:64Bit Multiplication - why doesn't this work?


"Alf P. Steinbach" <al...@online.no> writes:

Quote
>Mike Fee wrote:
>> ... lots of things with inline assembly code example.
>Why don't you simply use the built-in "comp" type?  It's 80
>bit, if I remember correctly, and it's integer (although
>it looks like a floating point type).

Tried that, but it was too slow (approximately half speed of the inline code,
which now works).

Mike.
--
Mike Fee
M....@irl.cri.nz
Industrial Research Limited

Re:64Bit Multiplication - why doesn't this work?


Re:64Bit Multiplication - why doesn't this work?


Why bother with INLINE when TP has the nice ASM...END feature? Your INLINE
code could be replaced by

ASM
   DB $66; MOV AX,X.WORD  {becomes MOV EAX,[X]}
   DB $66; MOV DX,Y.WORD  {becomes MOV EDX,[Y]}
   DB $66; MUL DX         {becomes MUL EDX}
   DB $66; MOV ZL.WORD,AX {becomes MOV [ZL],EAX}
   DB $66; MOV ZH.WORD,DX {becomes MOV [SH],EDX}
END ;

    -  Hans
--------------------------------------------------------------------------------
Hans Schleichert
Institut fuer Medizinische Psychologie und Verhaltensneurobiologie
(Institute of Medical Psychology and Behavioural Neurobiology)
Eberhard-Karls-University
Gartenstrasse 29
D-72074 Tuebingen, Germany
Voice      (+49-7071) 29-75997  NEW!
Fax        (+49-7071) 29-5956
Internet   <hans.schleich...@uni-tuebingen.de>
CompuServe [100031,775]

Other Threads