I learned assembly with nasm using intel syntax, but I like using at&t's
syntax, but something is confusing me...
I know immediate values must be preceded by $, but what is the
difference between
mov $label,%eax
mov label,%eax
Also, nasm uses square brackets to return a value from a memory address like:
mov eax,[label]
What is the at&t equivalent of the square brackets?
at&t syntax
Re:at&t syntax
For direct addressing, you would use the label with no prefix:
movl label, %eax
BTW, remember to use the size postfixes consistently; unlike in NASM, they are mandatory in GAS (AFAIK).
I've just added a page on AT&T syntax to the OS Developement FAQ, based on a posting I wrote several months ago. HTH.
movl label, %eax
BTW, remember to use the size postfixes consistently; unlike in NASM, they are mandatory in GAS (AFAIK).
I've just added a page on AT&T syntax to the OS Developement FAQ, based on a posting I wrote several months ago. HTH.