MASM is a freeware tool for writing programs on the x86 platform in assembly language. Officially MASM's title is the "MACRO ASSEMBLER", but is now more commonly referred to as the Microsoft Assembler.

History

MASM was first released in 1981. Microsoft developed the tool as their own in-house assembler, and chose to release it to the public as freeware to encourage development for their operating systems (the MASM license somewhat cheekily insists that you may only use it to assemble code targeted for Microsoft operating systems). In 1993 a 32-bit compatible version of MASM was released so that code could be written for the 32-bit Windows NT and the forthcoming Windows 95. As MASM remained Microsoft's in-house assembler, it has continually been updated and improved as necessary, making it a useful tool for programmers who want to take advantage of additions to the x86 architecture such as SSE2 instructions.

Why MASM?

MASM supports High Level Assembly language

Assembly language programming can be a tedious process leading to unreadable code, as the language provides no flow control constructs, or other high-level language features. MASM offers a set of macros which allow the programmer to use C-style constructs whilst still producing tight code.

MASM is a true assembler

Despite having high-level style constructs, MASM does exactly what it says on the tin - it is a macro assembler. In assembly language terms this is a good thing - we want our opcodes and data to be translated directly into their machine code equivalents, with no fussing around in-between. Un-enlightened people use MASM's HLA capabilities as fodder to criticise the tool, suggesting that offering high-level features entirely destroys the low-level nature of the language, leading to software which may as well have been written in C. This is a bogus argument. MASM's HLA features are simply macros which expand code to the same form as would have otherwise been written by the programmer. What's more, the HLA features are entirely optional - some programmers choose not to use them at all.

MASM is a suitable assembler for beginners

MASM has become the industry standard. Most modern x86 tutorials and references use MASM-compatible code as examples. Most x86 assembly source is written for MASM. This certainly makes it easier for the beginner assembly programmer to pick up the language, as they are not forced to convert code into a form which their own choice of assembler will understand. Coupled with the MASM's suite's ease of use and HLA, this makes MASM the best choice for beginners.

Syntax

MASM uses the familiar Intel syntax over the confusing (but perhaps more concise) AT&T syntax (as used in assemblers such as GAS).

Intel Syntax:

mov eax, 1 ;load register eax with the value 1

AT&T Syntax:

movl $1, %eax ;load register eax with the value 1

Source: http://www.masm32.com/

Log in or register to write something here or to contact authors.