Re: A basic question on asm

From: C (spamtrap_at_crayne.org)
Date: 09/24/04

  • Next message: Grumble: "Re: A basic question on asm"
    Date: Fri, 24 Sep 2004 09:24:22 +0000 (UTC)
    
    

    Percival wrote:
    > Rong wrote:
    >
    >> I ran into this x86 sentence:
    >> mov %eax,(%esp,1)
    >> I am not sure what (%esp, 1) part mean.
    >> And I could not find the explanation in x86 manual.
    >> Can anyone explain a little?
    >>
    >> Thank you,
    >>
    >>
    >
    > It is AT&T syntax. I am not familiar with it, but possibly the gas
    > manual or some sort should tell you what it means.
    >
    > My *GUESS*, and only a guess, is that it is mov [esp+1], [eax] in intel
    > syntax.
    >
    > But it is only a guess. I need to learn at&T syntax soon.
    >
    > Percival

    Close, your example would be "mov %eax, 1(%esp)" in gas.
    "mov %eax, (%esp,1)" is "mov [esp], eax" the 1 being the scale
    so "mov %eax,(%ebx,2)" is "mov [ebx*2], eax".

    PS: If you are debugging with gdb you can do...

    set disassembly-flavor intel

    Which should switch to Intel style syntax. (Yes, flavour is
    ment to be misspelled.)

    C
    2004-09-24


  • Next message: Grumble: "Re: A basic question on asm"

    Relevant Pages

    • Re: A basic question on asm
      ... > I ran into this x86 sentence: ... > mov %eax, ... > And I could not find the explanation in x86 manual. ... It is AT&T syntax. ...
      (comp.lang.asm.x86)
    • Re: Betovs crappy notation
      ... > mov D$eax 1 ... > Now I could pick on the syntax all day long, ... RosAsm Syntax is, like all Actual Assemblers Syntax, ...
      (alt.lang.asm)
    • Re: ADK/HLA v2.0 Update
      ... Sounds good - as long as it's only mov that has operand order ... > You won't see anywhere near this performance loss in HLA v2.0. ... This will allow you to create any syntax ... > Most people who've learned a different assembler don't. ...
      (alt.lang.asm)
    • Re: What does the move instruction mean?
      ... I'm trying to figure out the objdump result of my project. ... found a mov instruction I have never seen before. ... specified in AT&T syntax, but IIRC, ecx is the index in the above ... the intel syntax is just so much more readily understandable IMO. ...
      (comp.lang.asm.x86)
    • Re: Betovs crappy notation
      ... > Typing DWORD PTR may be slightly more work but the virtue of doing so ... There is a fundamental flaw in the logic put forward by certain assembler ... "Why not 'mov b$ebx 0'?" ... Intel Syntax and MASM's grammar is by no means ...
      (alt.lang.asm)