Mail Archives: djgpp/2001/01/03/11:45:03
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 -