delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/19/02:47:27

Date: Thu, 19 Nov 1998 09:47:36 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Ben Munger <TripWire AT idcomm DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Intel inline assembly?
In-Reply-To: <363016D3.F8D61F8C@idcomm.com>
Message-ID: <Pine.SUN.3.91.981119094712.27380B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Thu, 22 Oct 1998, Ben Munger wrote:

> Is there any way I can use intel inline assembly instead of AT&T?

Probably, no.  To achieve this, you will need to reconfigure and
rebuild GCC so that it invokes NASM as its assembler.  And for that,
you will have to change the output format of the compiler to be
acceptable by NASM.

The problem is that the compiler generates assembly and then invokes
the assembler to assemble it into machine code.  Inline assembly is
just passed to the assembler verbatim.  So this seemingly-innocent
request has major impacts on how the compiler works.

Seems like learning the AT&T syntax is much simpler, especially since
the differences are small (basically, reverse the operand order and
use e.g. movl instead of MOV).  See section 17.1 of the FAQ for
details.

Also, it might be that the code you are trying to write or port
doesn't require inline assembly at all, but can be written in C
without any lossage.  See section 17.8 of the FAQ, for one such
example.

- Raw text -


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