Mail Archives: djgpp/1999/12/12/13:39:36
From: | "Andrew Francis" <lpontiac AT bigpond DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Code compiles with v2.00 but not v2.02
|
Lines: | 45
|
X-Newsreader: | Microsoft Outlook Express 4.72.3110.1
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
Message-ID: | <zvQ44.4137$E4.7718@newsfeeds.bigpond.com>
|
Date: | Mon, 13 Dec 1999 01:03:21 +0800
|
NNTP-Posting-Host: | 139.134.144.222
|
X-Trace: | newsfeeds.bigpond.com 945017951 139.134.144.222 (Mon, 13 Dec 1999 03:59:11 EST)
|
NNTP-Posting-Date: | Mon, 13 Dec 1999 03:59:11 EST
|
Organization: | Telstra BigPond Internet Services (http://www.bigpond.com)
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
The following code is an extract from SMMU (http://doomnation.com/fraggle/),
which is a source port of the DOOM source code. I tried to compile it
straight out of the ZIP file, but all I get is:
---------
C:\Doom\s>gcc x.c
x.c: In function `FixedMul':
x.c:13: operand constraint contains '+' or '=' at illegal position.
---------
I recently got a new computer and installed DJGPP v2.02 from scratch, and it
built Allegro without complaining.
This exact same code compiled perfectly fine on the old computer, which was
running v2.00.
Anyone know what's up here?
----------- x.c:
typedef long fixed_t;
__inline__ static fixed_t FixedMul(fixed_t a, fixed_t b)
{
fixed_t result;
asm(" imull %2 ;"
" shrdl $16,%%edx,%0 ;"
: "=a,=a" (result) // eax is always the result
: "0,0" (a), // eax is also first operand
"m,r" (b) // second operand can be mem or reg
: "%edx", "%cc" // edx and condition codes clobbered
);
return result;
-------
Thanks.
Andrew Francis
areanynamesleft AT usa DOT net
}
- Raw text -