News for hackers. Stuff that matters.
Re:Explaining how the MASM 2-pass assembler works by WalterBright on Sunday September 12, 2021 @02:27PM (#28503540)
MASM 1.0 had a linear symbol table, which meant it quickly got excruciatingly slow as the file size increased.

MASM also uses the syntax one finds in the Intel CPU reference manuals. This is also done in the inline assembler for my compilers.

The gnu assembler syntax reverses the operands, which reverses the operands. This drives me crazy because assembler is hard enough without all the bugs from putting the operands in the wrong order.

Besides, I much prefer to be able to compare my assembler code with the Intel CPU specification.

Re:Explaining how the MASM 2-pass assembler works by mhh__ on Sunday September 12, 2021 @03:26PM (#28504054)
Angels die when AT&T syntax is used. I genuinely hate it.
Re:Explaining how the MASM 2-pass assembler works by pjmlp on Sunday September 12, 2021 @04:08PM (#28504430)
One day I had the stupid idea to replace the nasm macros of my toy compiler with generated Assembly directly, and to reduce dependencies rely on gas, back when Intel syntax was hardly supported, so AT&T it was.

Never again.

Re:Explaining how the MASM 2-pass assembler works by blake1 on Sunday September 12, 2021 @06:22PM (#28505606)
I strongly agree with your last sentence, but the issue goes beyond operand order: the addressing syntax for AT&T is nigh incomprehensible to me.
Re:Explaining how the MASM 2-pass assembler works by zh3 on Sunday September 12, 2021 @02:14PM (#28503436)
Using a 'JMP SHORT' was pretty much reflexive; a good reason to do it was it not being in range was sort of a code smell back in the day.

But chips were simpler back then, and a programmer could often leave compiler code in the dust with small bits of assembler (esp. where Fortran was involved).

Nowadays, X86 has become so hard to reason about from a performance point of view that for critical code I just assume that GCC will emit something acceptable given a bit of sensibly-written C, and that to get a big boost beyond that is going to involves GPUs or custom silicon (depending on the application).

Re:Explaining how the MASM 2-pass assembler works by sitzkrieg on Sunday September 12, 2021 @03:38PM (#28504174)
very true, esp when using const, static or restrict correctly
Re:Explaining how the MASM 2-pass assembler works by cdcarter on Sunday September 12, 2021 @02:10PM (#28503400)
Since it's not completely spelled out in the article, MASM was (is?) the Microsoft Macro Assembler. This is an x86 assembler that's been around since pretty much the beginning of the architecture.
Re:Explaining how the MASM 2-pass assembler works by genezeta on Sunday September 12, 2021 @02:51PM (#28503710)
> (is?)

Yes, it still is. It's no longer supplied separately and instead is included in Visual Studio (or in the "Build Tools for Visual Studio"), but it is still there. Newer, 64-bit, version is called ML64 but still referred to as MASM/Macro Assembler.

Re:Explaining how the MASM 2-pass assembler works by rnd0 on Sunday September 12, 2021 @07:48PM (#28506253)
>Yes, it still is. It's no longer supplied separately

well, it kinda/sorta is? https://www.masm32.com/

Though that's just about as unofficial as it gets!

Re:Explaining how the MASM 2-pass assembler works by pjmlp on Monday September 13, 2021 @02:39AM (#28508457)
I rather use the official one on the Windows SDK.

https://docs.microsoft.com/en-us/cpp/assembler/masm/microsof...

Re:Explaining how the MASM 2-pass assembler works by lolthishuman on Sunday September 12, 2021 @07:36PM (#28506173)
Anyone have thoughts on MASM compared to FASM?
Re:Explaining how the MASM 2-pass assembler works by 1vuio0pswjnm7 on Sunday September 12, 2021 @08:28PM (#28506548)
Yes. The flat assembler is much more useful. I can use it to produce executables for Linux, BSD and Windows.