Microsoft Macro Assembler

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Microsoft Macro Assembler
Developer(s) Microsoft
Stable release 12.0.21005.1 / November 8, 2013; 9 months ago (2013-11-08)
Operating system Microsoft Windows and MS-DOS
Type Assembler
License Microsoft EULA

The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel syntax for MS-DOS and Microsoft Windows. Beginning with MASM 8.0 there are two versions of the assembler - one for 16-bit and 32-bit assembly sources, and another (ML64) for 64-bit sources only.

MASM is maintained by Microsoft, but since version 6.12 has not been sold as a separate product, it is instead supplied with various Microsoft SDKs and C compilers. Recent versions of MASM are included with Microsoft Visual Studio.

History[edit]

The earliest versions of MASM date back to 1981.[1]

Early versions of MASM were sold either as a generic "Microsoft Macro Assembler" for all x86 machines and the OEM version produced specifically for IBM PCs. By Version 4.0, the IBM release was dropped. Up to Version 3.0, MASM was also bundled with a smaller companion assembler, ASM.EXE. This was intended for PCs with only 64k of memory and lacked some features of the full MASM such as the ability to use code macros.

DOS versions up to 4.x included Microsoft's LINK utility which was designed to convert intermediate OBJ files generated by MASM and other compilers, but as users who did not do programming had no use of LINK, it was moved to their compiler packages.

Version 4.0 added support for 286 instructions and also shorthand mnemonics for segment descriptors (.code, .data, etc). Version 5.0 supported 386 instructions, but could still only generate real mode executables.

Up to version 5.0, MASM was available as an MS-DOS application only. Versions 5.1 and 6.0 were available as both MS-DOS and OS/2 applications.[2]

Version 6.0, released in 1992, added parameter passing with "invoke" and some other high level-like constructs, in addition to the already existing high level-like records, among other things. By the end of the year, version 6.1A updated the memory management[how?][clarification needed] to be compatible with code produced by Visual C++. In 1993 full support for protected mode 32-bit applications and the Pentium instruction set was added. The MASM binary at that time was shipped as a "bi-modal" DOS-extended binary (using the Phar Lap TNT DOS extender).

Versions 6.12 to 6.14 were implemented as patches for version 6.11. These patches changed the type of the binary to native PE format; version 6.11 is the last version of MASM that will run under MS-DOS.

By the end of 1997 MASM fully supported Windows 95 and included some AMD-specific instructions.[3]

In 1999 Intel released macros for SIMD and MMX instructions, which were shortly after supported natively by MASM. With the 6.15 release in 2000, Microsoft discontinued support for MASM as a separate product, instead subsuming it into the Visual Studio toolset. Though it was still compatible with Windows 98, current versions of Visual Studio were not.[3] Support for 64-bit processors was not added until the release of Visual Studio 2005, with MASM 8.0.

Object module formats supported by MASM[edit]

Early versions of MASM generated object modules using the OMF format, which was used to create binaries for MS-DOS or OS/2.

Since version 6.1, MASM is able to produce object modules in the Portable Executable[4][5] (PE/COFF) format. PE/COFF is compatible with recent Microsoft C compilers, and object modules produced by either MASM or the C compiler can be routinely intermixed and linked into Win32 and Win64 binaries.

Some third-party tools that support MASM[edit]

IDEs[edit]

Debuggers[edit]

Disassemblers[edit]

Assemblers compatible with MASM[edit]

Some other assemblers can assemble most code written for MASM, with the exception of more complex macros.

  • Turbo Assembler (TASM) developed by Borland, later owned by Embarcadero, last updated in 2002 and supplied with Delphi and C++Builder for several years, later discontinued.
  • JWASM Macro Assembler, licenced under the Sybase Open Watcom EULA.
  • Pelle's Macro Assembler, a component of the Pelles C development environment.

See also[edit]

References[edit]

External links[edit]