Microsoft Macro Assembler

From Wikipedia for FEVERv2
(Redirected from MASM)
Jump to navigation Jump to search

Microsoft Macro Assembler_table_infobox_0

Microsoft Macro AssemblerMicrosoft Macro Assembler_table_caption_0
Developer(s)Microsoft Macro Assembler_header_cell_0_0_0 MicrosoftMicrosoft Macro Assembler_cell_0_0_1
Initial releaseMicrosoft Macro Assembler_header_cell_0_1_0 1981; 39 years ago (1981)Microsoft Macro Assembler_cell_0_1_1
Stable releaseMicrosoft Macro Assembler_header_cell_0_2_0 14.16.27023.1
  /    March 7, 2017; 3 years ago (2017-03-07)Microsoft Macro Assembler_cell_0_2_1
Operating systemMicrosoft Macro Assembler_header_cell_0_3_0 Microsoft Windows and MS-DOSMicrosoft Macro Assembler_cell_0_3_1
TypeMicrosoft Macro Assembler_header_cell_0_4_0 AssemblerMicrosoft Macro Assembler_cell_0_4_1
LicenseMicrosoft Macro Assembler_header_cell_0_5_0 Commercial proprietary softwareMicrosoft Macro Assembler_cell_0_5_1
WebsiteMicrosoft Macro Assembler_header_cell_0_6_0 Microsoft Macro Assembler_cell_0_6_1

The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel syntax for MS-DOS and Microsoft Windows. Microsoft Macro Assembler_sentence_0

Beginning with MASM 8.0, there are two versions of the assembler: One for 16-bit & 32-bit assembly sources, and another (ML64) for 64-bit sources only. Microsoft Macro Assembler_sentence_1

MASM is maintained by Microsoft, but since version 6.12 it has not been sold as a separate product. Microsoft Macro Assembler_sentence_2

It is instead supplied with various Microsoft SDKs and C compilers. Microsoft Macro Assembler_sentence_3

Recent versions of MASM are included with Microsoft Visual Studio. Microsoft Macro Assembler_sentence_4

History Microsoft Macro Assembler_section_0

The earliest versions of MASM date back to 1981. Microsoft Macro Assembler_sentence_5

They were sold either as the generic "Microsoft Macro Assembler" for all x86 machines or as the OEM version specifically for IBM PCs. Microsoft Macro Assembler_sentence_6

By Version 4.0, the IBM release was dropped. Microsoft Macro Assembler_sentence_7

Up to Version 3.0, MASM was also bundled with a smaller companion assembler, ASM.EXE. Microsoft Macro Assembler_sentence_8

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. Microsoft Macro Assembler_sentence_9

MS-DOS versions up to 4.x included Microsoft's LINK utility, which was designed to convert intermediate generated by MASM and other compilers; however, as users who did not program had no use of the utility, it was moved to their compiler packages. Microsoft Macro Assembler_sentence_10

Version 4.0 added support for 286 instructions and also shorthand mnemonics for segment descriptors (.code, .data, etc.). Microsoft Macro Assembler_sentence_11

Version 5.0 supported 386 instructions, but it could still only generate real mode executables. Microsoft Macro Assembler_sentence_12

Through version 5.0, MASM was available as an MS-DOS application only. Microsoft Macro Assembler_sentence_13

Versions 5.1 and 6.0 were available as both MS-DOS and OS/2 applications. Microsoft Macro Assembler_sentence_14

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. Microsoft Macro Assembler_sentence_15

By the end of the year, version 6.1A updated the memory management to be compatible with code produced by Visual C++. Microsoft Macro Assembler_sentence_16

In 1993 full support for protected mode 32-bit applications and the Pentium instruction set was added. Microsoft Macro Assembler_sentence_17

The MASM binary at that time was shipped as a "bi-modal" DOS-extended binary (using the Phar Lap TNT DOS extender). Microsoft Macro Assembler_sentence_18

Versions 6.12 to 6.14 were implemented as patches for version 6.11. Microsoft Macro Assembler_sentence_19

These patches changed the type of the binary to native PE format. Microsoft Macro Assembler_sentence_20

Version 6.11 is the last version of MASM that will run under MS-DOS. Microsoft Macro Assembler_sentence_21

By the end of 1997, MASM fully supported Windows 95 and included some AMD-specific instructions. Microsoft Macro Assembler_sentence_22

In 1999, Intel released macros for SIMD and MMX instructions, which were shortly thereafter supported natively by MASM. Microsoft Macro Assembler_sentence_23

With the 6.15 release in 2000, Microsoft discontinued support for MASM as a separate product, instead subsuming it into the Visual Studio toolset. Microsoft Macro Assembler_sentence_24

Though it was still compatible with Windows 98, current versions of Visual Studio were not. Microsoft Macro Assembler_sentence_25

Support for 64-bit processors was not added until the release of Visual Studio 2005, with MASM 8.0. Microsoft Macro Assembler_sentence_26

After 25 June 2015, there are at least three different MASMs with the version number 14.00.23026. Microsoft Macro Assembler_sentence_27

In Microsoft Visual Studio 2015 Enterprise Edition, there is one "amd64_x86" ml and two ml64s, "x86_amd64" and "amd64". Microsoft Macro Assembler_sentence_28

They run on different platforms targeting different platforms: Microsoft Macro Assembler_sentence_29

Microsoft Macro Assembler_unordered_list_0

  • amd64_x86: generates 64-bit code, runs in a Windows 32-bit environmentMicrosoft Macro Assembler_item_0_0
  • x86_amd64: generates 32-bit code, runs in a Windows 64-bit environmentMicrosoft Macro Assembler_item_0_1
  • amd64: generates 64-bit code, runs in a Windows 64-bit environmentMicrosoft Macro Assembler_item_0_2

Object module formats supported by MASM Microsoft Macro Assembler_section_1

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

Since version 6.1, MASM is able to produce object modules in the Portable Executable (PE/COFF) format. Microsoft Macro Assembler_sentence_31

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. Microsoft Macro Assembler_sentence_32

Assemblers compatible with MASM Microsoft Macro Assembler_section_2

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

Microsoft Macro Assembler_unordered_list_1

  • Turbo Assembler (TASM) developed by Borland, later owned by Embarcadero, last updated in 2002, but still supplied with C++Builder and .Microsoft Macro Assembler_item_1_3
  • JWASM Macro Assembler, licensed under the Sybase Open Watcom EULA.Microsoft Macro Assembler_item_1_4
  • Pelle's Macro Assembler, a component of the development environment.Microsoft Macro Assembler_item_1_5
  • is a free MASM-compatible assembler based on JWasm.Microsoft Macro Assembler_item_1_6

Mixed language programming support Microsoft Macro Assembler_section_3

Documentation for 1987's version 5.1 included support for "Microsoft BASIC, C, FORTRAN, Pascal." Microsoft Macro Assembler_sentence_34

Licensing issues Microsoft Macro Assembler_section_4

Using MASM for operating system development is not prohibited in the license agreement although you may sometimes hear that. Microsoft Macro Assembler_sentence_35

This is because people often confuse the MASM and MASM32 licenses; they are two unrelated projects. Microsoft Macro Assembler_sentence_36

See also Microsoft Macro Assembler_section_5

Microsoft Macro Assembler_unordered_list_2

Credits to the contents of this page go to the authors of the corresponding Wikipedia page: Macro Assembler.