Re: GNU assembler freaks out at jumps and Intel syntax
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=n+5vNscuoRWN9JprMudbNvGvI2nkWtIIxDzHRUMn29xE1mPcJePvY99dV0i8G/z4mBvO90WMoKTDtP/1vVMY/+qpfThoahH67Bsv0mrRaH3vcqolushpkemPB1PQbdYOokxCtnyj3YuFhAG2mskoL2gfv9++BgpQ4feOWMq7aaA=; Not quite sure what you mean with that, is the AT&T syntax more "logical" for any particular reason? Anyway, my reason is a compiler emitting asm (Intel syntax), I'd planned to use gas a back-end. It needs to able to address labels at any arbitrary position in the source, therefore the 1b/1f isn't good enough. Though I cannot find any specific reference in the docs concering use of "j<cc>" instructions when using intel syntax ,this is starting to look like a bug in gas itself. I'll give a shot at the binutils mailing list. Thanks anyway. Luigi --- On Tue, 9/16/08, Terry Lambert <tlambert@apple.com> wrote:
From: Terry Lambert <tlambert@apple.com> Subject: Re: GNU assembler freaks out at jumps and Intel syntax To: news4e71@yahoo.com Cc: darwin-dev@lists.apple.com Date: Tuesday, September 16, 2008, 1:26 AM Ah, you have some reason other than logic for using Intel syntax.
Change it to this:
1: L5: popl %ebx cmpl $2, 8(%ebp) je L2 leal LC0-"L00000000001$pb"(%ebx), %eax movl %eax, (%esp) call L_puts$stub .intel_syntax noprefix test %eax, %eax jnz 1b .att_syntax
-- Terry
On Sep 15, 2008, at 4:15 PM, LuigiG wrote:
But that's using the AT&T syntax. That has always worked fine for me too, it's only when you switch to Intel syntax that you get problems.
If I chnage your example to use Intel syntax (even limited to that small bit of code), it doesn't work anymore:
This assembles (and links) correctly: testl %eax,%eax jnz L5
This will fail: .intel_syntax noprefix test eax,eax jnz L5 .att_syntax
foo.s:28:suffix or operands invalid for `jnz'
So, is this a bug in gas? Or must I prepend/append something "L5" when using Intel syntax? (which would seem to contradict the "noprefix" option!)
Luigi
Note: I'm on an intel Mac and both -arch i386 and -arch x86_64 give the same result.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
LuigiG