delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/19/11:28:36

Date: Sun, 19 Oct 1997 17:23:47 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Genady Beryozkin <c0467082 AT techst02 DOT technion DOT ac DOT il>
cc: djgpp AT delorie DOT com
Subject: Re: Why not build in inline 80x86 assembly, like in borland C
In-Reply-To: <34452541.505CB073@t2.technion.ac.il>
Message-ID: <Pine.SUN.3.91.971019172327.27221W-100000@is>
MIME-Version: 1.0

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 -


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