ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/03/01:17:37

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: help with inline AT&T assembly
Date: Wed, 03 Apr 2002 08:57:30 +0300
Lines: 12
Message-ID: <3CAA99CA.33B1298D@is.elta.co.il>
References: <20020402131311 DOT 21631 DOT 00001396 AT mb-fa DOT aol DOT com>
Mime-Version: 1.0
X-Trace: fu-berlin.de 1017813709 28637781 (16 [61365])
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sterten wrote:
> I wanted to convert my inner loop to assembly ,
> it did compile but it doesn't do what the C-routine does.
> I'm new to AT&T syntax , where is the mistake ?

I think the order of the operands is wrong: the AT&T syntax reverses them
(first source, then destination).  That is, "movl %%ebx,%1" puts what's in
EBX into the 1st arg, not the other way around.  The same reversal of
operands happens with addl.

I believe this is explained in section 17.1 of the DJGPP FAQ list.

- Raw text -

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