delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/03/11:45:03

Date: Wed, 3 Jan 2001 18:37:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Shawn Harrison <zils AT fuse DOT net>, crazyfingers AT fuse DOT net,
harrisso AT email DOT uc DOT edu, shou2 AT juno DOT com
cc: djgpp AT delorie DOT com
Subject: Re: How does OR Will gcc produce assembler output in intel syntax with the new GAS ".intel_syntax" directive
In-Reply-To: <t56f3m8qk544fc@corp.supernews.com>
Message-ID: <Pine.SUN.3.91.1010103183144.4647B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 3 Jan 2001, Shawn Harrison wrote:

> > Why do you need this?
> It makes porting code easier without a lot of unnecessary recoding, plus if
> its something that can
> be controlled from inside the C source with the aid of #define 's then the
> code can be output to
> other assemblers that are intel syntax'ed by default

I'm still not sure I understand: do you need this to take the assembly 
and feed it to an external assembler?  Otherwise, I don't see how is
portability related to all this: C code is always portable.

If you indeed want to feed the assembly to an assembler other than Gas, 
you need a converter from AT&T to Intel format; the DJGPP FAQ mentions 
several possibilities in section 17.2.

> > If it's to look at the produced code in syntax
> > you are used to, you can use the objdump utility on the .o file
> 
> that would be great if I wanted to go from intel to at&t syntax
> say from a *.s file that was written using the .intel_syntax directive
> and compiled to an *.o file
> But its the other way around and you're just back to where you
> started at.

No, I don't think so.  You want to see the code produced by GCC in Intel 
format.  objdump can print the disassembly of the .o file in either AT&T 
or Intel format.  You want the latter.

Of course, objdump is only good for looking at the code off line, not for 
some automated procedure where assembly output by GCC is directly fed to 
an assembler.  But I think the output of "gcc -S" cannot be fed directly 
to an assembler anyway, due to all kinds of fancy formatting and 
decorations.

- Raw text -


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