MASM is Microsoft's Macro Assembler tool for converting assembly language to object code. It processes x86 instructions and pseudo instructions written in "Intel syntax". MASM is the standard low-level language for all MSDOS and Windows environments and is currently being supported in the 32-bit and 64-bit versions.
This tag is for questions related specifically to MASM. General questions about assembly language should be tagged assembly or assembler. Questions specifically about the CPU should be tagged x86 8086 x86-64 i386 and/or sse. Further, questions about the masm32 SDK and IDE should also be tagged accordingly. Other competing assemblers include tasm gas and nasm: Check the documentation of the respective softwares to verify the degree of compatibility with MASM specific source code.
MASM has been available since MSDOS 1.0 in 1981 and was a separate product until about 1999; since then it has been packaged with other tools, primarily Visual Studio. While the most current version is no longer available for download, it is provided with Visual C++ and accessible via the command line.
MASM contains a powerful macro capability, a preprocessor with access to program symbols and can string manipulation, conditional assembly, and some C
-like syntax (if
...elseif
...else
...endif
, while
..endw
, and repeat
..until
). Other features include variable typing, type casting and argument type checking.
Much of the difficulty of using MASM is related to the complexity and non-orthogonality of Intel's CPU architecture. Because of advances in processor technology, the assembly language has similarly expanded and advanced, though sometimes haphazardly. For example, the LOOP
and REP
instructions are implicitly only able to use the register CX
(or ECX
in 32-bit mode), owed to the design of the instruction set.
Expect extensive pre-planning and graduate level research to be required for usage of MASM to be fruitful.
Resources: