Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between masm32 and masm?

I am trying to learn assembly for windows and see that there are 2 assemblers:

masm : https://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64

masm32 : http://masm32.com/index.htm

are these equivalent? which one should i choose to learn assembly for windows?

like image 253
Jumbo Avatar asked Nov 02 '10 08:11

Jumbo


1 Answers

It's both MASM (apparently), just different versions. I'd normally use the official (MS) link. MASM is also part of the Windows SDK now - if you install it, it contains ML.exe in the bin directory.

If you're just using it to learn assembly language, the MASM version used doesn't make much of a difference. Newer versions of MASM add support for 64 bits (ML64.exe) and newer instructions as they get added to the x86 instruction set, but that's about it. The main differences between different assemblers are the different dialects. There's 3 main dialects of x86 assembly language: MASM syntax, NASM syntax and Unix-style as syntax (there also used to be Borland TASM, but that's pretty much dead nowadays). MASM, NASM and YASM all use the same instruction and register names but have some slightly differing conventions (dword ptr [blah] vs. dword [blah] etc.) and quite different macro languages. MASM also has some higher-level constructs like .if / .endif, invoke etc. that don't exist in other Assemblers. Whether that's an advantage or not is a matter of taste, I personally prefer the NASM style syntax because it's more regular and I find the macro preprocessor more convenient to use, but that's a matter of taste.

as is a different matter. It uses a completely different syntax and instruction names that differ from what's given in the Intel manuals. It's the default on most Unix variants (and also in compilers that come from that environment, e.g. GCC) but basically unused outside that environment. Current versions of GNU as support Intel syntax too, which makes most of the syntactic differences go away, but as in general is mainly intended as a backend assembler for compilers and not a fullly-fledged macro assembler, so it still has a very limited featureset compared to MASM or NASM/YASM.

like image 62
Fabian Giesen Avatar answered Oct 04 '22 14:10

Fabian Giesen