delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/02/13/23:56:26

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Tue, 14 Feb 2006 04:32:17 +0000 (GMT)
From: "A. Wik" <djgpp-l AT aw DOT gs>
To: djgpp AT delorie DOT com
Subject: Re: Converting Intel code
In-Reply-To: <43d4e943_2@x-privat.org>
Message-ID: <20060214041531.F25657@dynamite.narpes.com>
References: <43d4e943_2 AT x-privat DOT org>
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

gas (the GNU assembler, into which gcc feeds its output,
whether compiled C or inlined assembly) supports Intel
syntax now, at least on Linux.  You invoke it by preceding
your code with the directive:

	.intel_syntax

Even better, invoking gcc with a "-masm=intel" switch will
make it generate Intel-style assembly.

-aw
PS. I haven't tested any of the above with DJGPP's gcc,
but the theory is plausible.

On Mon, 23 Jan 2006, Cristiano wrote:

> I need to translate this (it should read the same timer used by Win API 
> QueryPerformanceCount):
> 
>     unsigned short val;
>     cli
>     xor al,al
>     out 43h,al
...

> into AT&T syntax (for DJGPP). I wrote this:
> asm(
>   "cli\n\t"
>     "xor %al,%al\n\t"
>     "out %al,$0x43\n\t"
...

- Raw text -


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