Mail Archives: djgpp/1997/10/19/11:28:36
On Wed, 15 Oct 1997, Genady Beryozkin wrote:
> The most rediculous thing about it is that when I debug my AT&T style
> code with that FSDB debugger, I get it back in INTEL style !
You mix two different things here. The assembly syntax (either Intel
or AT&T) may be different, but the machine language produced by the
assembler is the same in both cases!
The way machine code is *displayed* by a debugger depends on the
disassembler that is part of that debugger. It so happens that the
author of FSDB elected to make his disassembler produce Intel style.
Other debuggers may do it differently.
> Assembler is supposed to be machine-dependent.
Assembly *language* is indeed machine-dependent, but the assembler
need not change that much, if the overall structure and high-level
syntactic constructs of the language don't change. If you change
those as well, you will need to rewrite the Gas parser grammar for
every machine. Right now, every machine has its machine-dependent
files which describe e.g. the available registers etc., but most of
the assembler sources don't change.
(Btw, usually, the C compiler is machine-dependent as well, although
the C language is not. GCC is unique in that most of the compiler
don't change at all when you port it to another CPU. All you need to
produce is a bunch of files that describe the target machine.)
> I also agree that INTEL&TASM&MASM etc standard is a little more
> wide-used than AT&T standard - so why do you bother to waste your time
> just for compatibility with SPARC & other?
Well, I ``waste my time'' in a variety of ways, but none of them is
because of the Gas syntax. I actually find AT&T style to be better
than Intel style. Using the AT&T style actually saves some waste of
time, because we need not bother writing a new assembler, we just use
the GNU Assembler as is.
- Raw text -