Hacker News new | ask | show | jobs
by gregschlom 5351 days ago
> So why do we need multiple assembly language syntaxes?

There are here for historical reasons, I suppose. Nobody wants to have two assembly syntaxes, but now that we have them, everyone wants his syntax of choice to be the only one.

I learned assembly 10 years ago with the Intel syntax (actually, I wasn't even aware that there was another syntax until recently), and I really dislike the AT&T syntax. So what do I do now? Learn another syntax, or just fight against it?

So, there's no way to get rid of one syntax in favor of the other... The perfect solution would be to have a tool to translate automatically from one to the other.

Should be possible, what do you think?

1 comments

Assembly without macros is pretty much one-to-one with machine code. Depending on your toolchain you could easily write a shell one-liner to assemble and disassemble it into the other syntax.

With macros, it would be completely impractical to do in the general case, considering the disparity between the macro systems of different assemblers (gas with the C preprocessor, nasm, etc. with their own macro systems).