NASM -> GNU ASM

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:NASM -> GNU ASM

Post by Solar »

Kemp wrote: Just in case anyone takes you seriously...
???
Every good solution is obvious once you've found it.
Kemp

Re:NASM -> GNU ASM

Post by Kemp »

Lol, sorry. I meant in case anyone obssessive about Intel syntax took you too seriously. Don't want a religious war on our hands. I would never suggest people who use AT&T syntax shouldn't be taken seriously ;) ;D
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:NASM -> GNU ASM

Post by Solar »

Ah, ok.
Every good solution is obvious once you've found it.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:NASM -> GNU ASM

Post by Brendan »

Hi,

In my experience, it doesn't matter if it's "opcode, source, dest" or "opcode dest, source" - it takes just a little time to get used to if you change.

My main problem with AT&T syntax is things like "[label + esi + eax * 4 + structure.field]", which looks like normal maths in Intel syntax.

My favourite would be 6502 syntax, where there's never more than one operand:

[tt] lda 12 ;Load 12 into the accumlator
sta 0x100 ;Store the accumulator at 0x100[/tt]

Only having 3 general registers and a very limited instruction set makes it very easy to learn...

BTW, if the world was a democracy we'd probably be writing assembly like this:

[tt]m s a
o u d
v b d

e [ e
a b b
x a x
, r ,
[ ] e
f , a
o e x
o c
] x[/tt]

Just a thought....


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Kemp

Re:NASM -> GNU ASM

Post by Kemp »

At least we could impress non-programmers with our "matrix code", lol.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:NASM -> GNU ASM

Post by bubach »

Intel syntax can't even be compared to that AT&T %%&#"?@??!!! ;D
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:NASM -> GNU ASM

Post by Candy »

bubach wrote: Intel syntax can't even be compared to that AT&T %%&#"?@??!!! ;D

Code: Select all

echo "....." >asmfile.asm
intel2gas -r <asmfile.asm >asmfile.S
diff asmfile.asm asmfile.S
Yes, you can indeed compare them.
AR

Re:NASM -> GNU ASM

Post by AR »

I don't get the point of arguing over the syntax, it's about as effective as arguing over which assembler is better (assuming the ones being compared both support the entire instruction set), or which code editor, etc, etc.

I personally prefer GAS because I find it easier to understand at a glance, is integrated into GCC and feels more logical to me (left to right as opposed to left to right to left ordering) but if you prefer Intel syntax then use whatever makes you happy.

Less seriously, I wonder if I could create a new dialect of ASM with the Intel layout to the extreme:

Code: Select all

eax, 4 mov
ebx, 5 mov
eax, ebx add

; Or maybe even:
xae, 4 vom
xbe, 5 vom
xae, xbe dda
;D
Kemp

Re:NASM -> GNU ASM

Post by Kemp »

Well that first one would make much more sense to some people :P
Post Reply