Intel syntax with GAS?
Posted: Tue Dec 15, 2020 7:38 pm
The wiki article on GAS recommends not using GAS's intel syntax. It gives two reasons:
Should the wiki page be updated? Are there any other reasons people know of for avoiding GAS's intel syntax? It's worked great for me, personally.
- Even in intel mode, operands are reversed in some cases
- Assembly produced may be suboptimal
Code: Select all
$ cat testatt.s
.code16 ; NB. I get the same results in 64-bit mode
f1:
mov $5, %si
mov %di, %si
mov %ax, %si
movsx %al, %si
movsb (%si), (%di)
$ cat testintel.s
.intel_syntax noprefix
.code16
f1:
mov si, 5
mov si, di
mov si, ax
movsx si, al
movsb [di], [si]
$ as testatt.s -o testatt.o && as testintel.s -o testintel.o
$ diff test{att,intel}.o && echo same
same