gas vs. nasm syntax

Charles Bailey yasm at hashpling.org
Sat Jun 9 06:40:02 PDT 2007


Peter Johnson wrote:
> On Fri, 8 Jun 2007, Charles Bailey wrote:
>> This could prove to be a really dumb question but are the following two
>> versions of assembler the same?
> 
> No they are not.

OK, it was a dumb question :) .  I was reading the documentation about
the coding of ModR/M byte and completely forgot I was dealing with an
address in the trivial "disp32 only" case.

      7                                 f:
      8 00000000 55                      push ebp
      9 00000001 8B15[00000000]          mov edx, [arr]
     10 00000007 89E5                    mov ebp, esp
     11 00000009 8B4508                  mov eax, [ebp + 8]
     12 0000000C 5D                      pop ebp
     13 0000000D 8B0482                  mov eax, [edx + 4*eax]
     14 00000010 C3                      ret

That's better :) .

Thanks for your help,

Charles.


More information about the yasm-devel mailing list