delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/09/17:15:30

From: "John S. Fine" <johnfine AT erols DOT com>
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: <Pine DOT SUN DOT 3 DOT 91 DOT 980908101052 DOT 26824C-100000 AT is> <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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Endlisnis wrote:

> marked the place where it screws up, in the add function.  Is there something
> I'm doing wrong?
> 
> #include <iostream.h>
> 
> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019