Mail Archives: djgpp/1997/01/05/16:47:56
Bob Platko wrote:
>
> I can't seem to get the following code to work in DJGPP.
>
> long Mul16_16( long a, long b );
> #pragma aux Mul16_16 =\
> "imul edx",\
> "shrd eax,edx,16"\
> parm [eax] [edx]
>
> Any sugestions? Is there another way to multiply two 16.16 fixed point
> numbers,
> returning a 16.16 result?
Use extended asm (info gcc "c ex" ex) (note, the code is untested and I
may have the %1 (%edx) and %0 (%eax) reversed and the '&' may not be
needed.
asm("
imull %1
shrdl $16,%1,%0
"
:"=&a"(result) /* output %eax->result */
:"b"(d),"a"(a) /* input, a->%eax b->%edx */
:"%edx" /* modified registers not in output */
);
Bill
--
Leave others their otherness.
- Raw text -