Date: Mon, 06 Jan 1997 10:42:55 +0000 From: Bill Currie Subject: Re: undefined reference using #pragma aux To: Bob Platko Cc: djgpp AT delorie DOT com Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <32D0D72F.7732@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <01bbf5d6$380e7a60$93f15ecf AT platko DOT ix DOT netcom DOT com> 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.