From: "John S. Fine" Newsgroups: comp.os.msdos.djgpp Subject: Re: Bug in GCC? Date: Wed, 09 Sep 1998 17:05:20 -0400 Lines: 22 Message-ID: <35F6ED90.6D81@erols.com> References: <35F5B07A DOT 8E37D184 AT unb DOT ca> Reply-To: johnfine AT erols DOT com NNTP-Posting-Host: 207-172-241-98.s35.as6.bsd.erols.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Endlisnis wrote: > marked the place where it screws up, in the add function. Is there something > I'm doing wrong? > > #include > > int add(int a, int b) > { > int Ret; > asm ("addl %1, %0" //this line compiles to "addl ecx,ecx". > : "=&r" (Ret) > : "0" (a), "r" (b) > ); > return Ret; > } Try "addl %2, %0" -- http://www.erols.com/johnfine/ http://www.geocities.com/SiliconValley/Peaks/8600/