• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GNU assembler freaks out at jumps and Intel syntax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU assembler freaks out at jumps and Intel syntax


  • Subject: Re: GNU assembler freaks out at jumps and Intel syntax
  • From: LuigiG <email@hidden>
  • Date: Mon, 15 Sep 2008 16:46:24 -0700 (PDT)

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 <email@hidden> wrote:

> From: Terry Lambert <email@hidden>
> Subject: Re: GNU assembler freaks out at jumps and Intel syntax
> To: email@hidden
> Cc: email@hidden
> 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    ëx
>         cmpl    $2, 8(ëp)
>         je      L2
>         leal    LC0-"L00000000001$pb"(ëx), êx
>         movl    êx, (%esp)
>         call    L_puts$stub
> .intel_syntax noprefix
>         test    êx, êx
>         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   êx,êx
> > 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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: GNU assembler freaks out at jumps and Intel syntax (From: Terry Lambert <email@hidden>)

  • Prev by Date: Re: GNU assembler freaks out at jumps and Intel syntax
  • Next by Date: spinlock under fork()?
  • Previous by thread: Re: GNU assembler freaks out at jumps and Intel syntax
  • Next by thread: launchd wrong behavior for nonexistent paths and crashed services
  • Index(es):
    • Date
    • Thread