Mail Archives: djgpp/1997/08/03/17:42:29
On 2 Aug 97 at 23:02, Georg Kolling wrote:
> Mark Goodwin schrieb:
> > inline static long FIXDIV(long Num, long Denom)
> > {
> > long Result;
> > asm ("movl Num, %%eax;"
> > "movl %%eax, %%edx;"
> > "sarl %%edx, 16;"
> > "shll %%eax, 16;"
> > "idivl Denom"
>
> You just have to use _Num and _Denom!
Nope, uses extended asm instead (Mark was getting close):
asm ("movl %1, %%eax;"
"movl %%eax, %%edx;"
"sarl %%edx, 16;"
"shll %%eax, 16;"
"idivl %2"
:"=a"(Result) /* output */
:"g"(Num),"g"(Denom) /* input */
:"%edx" /* modified */
);
Bill
--
Leave others their otherness.
- Raw text -