i86, AT&T syntax, GNU as

From: Axel Schlicht (axel.schlicht_at_mail.isis.de)
Date: 05/22/04


Date: Sat, 22 May 2004 18:03:29 +0000 (UTC)

Hi folks

can anyone out there help me with two short questions?
I have an assembler listing of an C program

What does
pushl -4(%ebp)
leal -4(%ebp), %eax
incl (%eax)
mean ?

I assume
pushl -4(%ebp) == push double word
leal -4(%ebp), %eax == leal = lea to double word, but whats -4()
incl (%eax) == inc [eax] with eax pointing to a double word

does () represent [] in Intel syntax?

And what does
.section .rodata
...
.text
.globl main
.type main, @function
mean?

.section .rodata read only data ?
...
.text == section .text in Intel syntax
.globl main == global main in Intel syntax
.type main, @function ???

Where can I find a list of all AT&T commands compared to their Intel
counterpart, or rather a list of differences?
e. g., mov %eax, %ebx etc. really is no problem
nor suffixes (b, w, l)
but stuff like -4(%ebp) etc. do look a little strange

Thanks in advance

Axel Schlicht



Relevant Pages

  • Help translating Intel to AT&T
    ... I'm trying to translate a program from the Intel syntax to AT&T syntax ... descriptor into eax ...
    (comp.lang.asm.x86)
  • Re: Signum Benchmark revisited
    ... and lea allow you to keep the old eax without needing to make an extra ... pushl %esi ... movl 20, %eax ... movl 20, %ecx ...
    (comp.lang.java.programmer)
  • Re: + espfix-code-cleanup.patch added to -mm tree
    ... temporary for the segment comparison) which I could not follow exactly in patch format. ... The reason for removal was that I also removed the xorl %eax,%eax, decl %eax ... pushl $do_iret_error ... Now, if we have a bad user's iret frame, the iret will ...
    (Linux-Kernel)
  • [patch] espfix cleanup take 2
    ... Introduced GET_DESC_BASEmacro to be used from asm ... pushl %eax; \ ... movl %ss, %eax; \ ...
    (Linux-Kernel)
  • [patch] espfix cleanup take 3
    ... pushl %eax; \ ... movl %ss, %eax; \ ... CFI_REL_OFFSET ecx, 0 ...
    (Linux-Kernel)