HOME

TheInfoList



OR:

Microsoft Macro Assembler (MASM) is an
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
assembler that uses the
Intel syntax x86 assembly language is a family of low-level programming languages that are used to produce object code for the x86 class of processors. These languages provide backward compatibility with CPUs dating back to the Intel 8008 microprocessor, in ...
for
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
and
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
. Beginning with MASM 8.0, there are two versions of the assembler: One for
16-bit 16-bit microcomputers are microcomputers that use 16-bit microprocessors. A 16-bit register can store 216 different values. The range of integer values that can be stored in 16 bits depends on the integer representation used. With the two ...
&
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in a maximum of 32- bit units. Compared to smaller bit widths, 32-bit computers can perform la ...
assembly sources, and another (ML64) for
64-bit In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, a ...
sources only. MASM is maintained by
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
, but since version 6.12 it has not been sold as a separate product. It is instead supplied with various Microsoft SDKs and C
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
s. Recent versions of MASM are included with
Microsoft Visual Studio Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms ...
. Notable applications compiled using MASM are RollerCoaster Tycoon which was 99% written in assembly language and built with MASM.


History

The earliest versions of MASM date back to 1981. The IBM PC Macro Assembler was released in December 1981. They were sold either as the generic "Microsoft Macro Assembler" for all x86 machines or as the OEM version specifically for
IBM PC The IBM Personal Computer (model 5150, commonly known as the IBM PC) is the first microcomputer released in the List of IBM Personal Computer models, IBM PC model line and the basis for the IBM PC compatible ''de facto'' standard. Released on ...
s. By Version 4.0, the
IBM International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
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. MS-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; however, as users who did not program had no use of the utility, it was moved to their compiler packages. Version 4.0, released October 1985, added support for 286 instructions. Version 5.0, released August 1987, supported
386 __NOTOC__ Year 386 (Roman numerals, CCCLXXXVI) was a common year starting on Thursday of the Julian calendar. At the time, it was known as the Year of the Consulship of Honorius and Euodius (or, less frequently, year 1139 ''Ab urbe condita''). ...
instructions, and also shorthand mnemonics for segment descriptors (.code, .data, etc.), but it could still only generate real mode executables. Through version 5.0, MASM was available as an
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
application only. Versions 5.1 and 6.0 were available as both
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
and
OS/2 OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
applications. Version 6.0, released in 1991, 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. Both 6.0 and 6.0B were able to be run on an
8086 The 8086 (also called iAPX 86) is a 16-bit microprocessor chip designed by Intel between early 1976 and June 8, 1978, when it was released. The Intel 8088, released July 1, 1979, is a slightly modified chip with an external 8-bit data bus (allo ...
processor but could generate flat 32-bit 386 code. In 1992, 6.1 was released, which added support for the COFF object format used by
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
, and removed support for OS/2. 6.1 was built as a bi-modal binary before the Win32 API was finalized, and is incompatible with running on Windows NT due to missing exports. In 1993 full support for protected mode 32-bit applications and the
Pentium Pentium is a series of x86 architecture-compatible microprocessors produced by Intel from 1993 to 2023. The Pentium (original), original Pentium was Intel's fifth generation processor, succeeding the i486; Pentium was Intel's flagship proce ...
instruction set was added. The 6.11 MASM binary at that time (1993) was shipped as a "bi-modal" (win32, i.e. PE) DOS-extended binary (using the
Phar Lap Phar Lap (4 October 1926 – 5 April 1932) was a New Zealand-born champion Australian Thoroughbred horse racing, racehorse. Achieving great success during his distinguished career, his initial underdog status gave people hope during the ear ...
TNT DOS extender). However, the setup.exe is an MZ executable so won't run under 64-bit versions of Windows, and the bi-modal ml.exe is compressed, and the decomp.exe is an NE executable, so also won't run under 64-bit versions of Windows, so you effectively need access to 32-bit Windows (or MSDOS) in order to install it. Version 6.11 is the last version of MASM that will run under MS-DOS. There were a series of patches available, up to 6.11d, that need 32-bit Windows to run, but the patched ml.exe still has the Phar Lap dos extender so can still be run under MSDOS. By the end of 1997, MASM fully supported
Windows 95 Windows 95 is a consumer-oriented operating system developed by Microsoft and the first of its Windows 9x family of operating systems, released to manufacturing on July 14, 1995, and generally to retail on August 24, 1995. Windows 95 merged ...
and included some
AMD Advanced Micro Devices, Inc. (AMD) is an American multinational corporation and technology company headquartered in Santa Clara, California and maintains significant operations in Austin, Texas. AMD is a hardware and fabless company that de ...
-specific instructions. In 1999, Intel released macros for
SIMD Single instruction, multiple data (SIMD) is a type of parallel computer, parallel processing in Flynn's taxonomy. SIMD describes computers with multiple processing elements that perform the same operation on multiple data points simultaneousl ...
and MMX instructions, which were shortly thereafter 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 Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development ...
toolset. Though it was still compatible with
Windows 98 Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the second operating system in the 9x line, as the successor to Windows 95. It was Software ...
, current versions of Visual Studio were not. Support for 64-bit processors was not added until the release of
Visual Studio 2005 Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development ...
, with MASM 8.0. After 25 June 2015, there are at least three different MASMs with the version number 14.00.23026. In Microsoft Visual Studio 2015 Enterprise Edition, there is one "amd64_x86" ml and two ml64s, "x86_amd64" and "amd64". They run on different platforms targeting different platforms: * amd64_x86: generates 64-bit code, runs in a Windows 32-bit environment * x86_amd64: generates 32-bit code, runs in a Windows 64-bit environment * amd64: generates 64-bit code, runs in a Windows 64-bit environment


Object module formats supported by MASM

Early versions of MASM generated object modules using the OMF format, which was used to create binaries for
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
or
OS/2 OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
. Since version 6.1, MASM is able to produce object modules in the
Portable Executable The Portable Executable (PE) format is a file format for executables, object file, object code, Dynamic-link library, dynamic-link-libraries (DLLs), and binary files used on 32-bit and 64-bit Microsoft Windows, Windows operating systems, as well ...
(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.


Assemblers compatible with MASM

Some other assemblers can assemble most code written for MASM, with the exception of more complex macros. * Turbo Assembler (TASM) developed by
Borland Borland Software Corporation was a computing technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad, and Philippe Kahn. Its main business was developing and selling software development and software deployment products. B ...
, later owned by Embarcadero, last updated in 2002, but still supplied with
C++Builder C++Builder is a rapid application development (RAD) environment for developing software in the C++ programming language. Originally developed by Borland, it is owned by Embarcadero Technologies, a subsidiary of Idera. C++Builder can compile ...
an
RAD Studio
* JWasm Macro Assembler, licensed under the Sybase Open Watcom
EULA An end-user license agreement or EULA () is a legal contract between a software supplier and a customer or end-user. The practice of selling licenses to rather than copies of software predates the recognition of software copyright, which has ...
. Last updated in 2014. * Pelle's Macro Assembler, a component of th
Pelles C
development environment.

is a free MASM-compatible assembler based on JWasm.
ASMC
is a free MASM-compatible assembler based on JWasm.


Mixed language programming support

Documentation for 1987's version 5.1 included support for "
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first v ...
, C, FORTRAN, Pascal."


Reception

In a review of three assemblers, Michael Blaszczak of ''
BYTE The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
'' in February 1989 found that MASM 5.1 was the slowest and complained the most about code. He concluded that "MASM takes some getting used to, but it gets the job done" despite "more than its fair share of frustrating quirks and oddities".


See also

*
Microsoft MACRO-80 Microsoft MACRO-80 (often shortened to M80) is a relocatable macro assembler for Intel 8080 and Zilog Z80 microcomputer systems. The complete MACRO-80 package includes the ''MACRO-80 Assembler'', the ''LINK-80 Linking Loader'', and the ''CREF- ...
*
Assembly language In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
*
High-level assembler A high-level assembler in computing is an assembler for assembly language that incorporate features found in a high-level programming language. The earliest high-level assembler was probably Burroughs' Executive Systems Problem Oriented Languag ...
*
Comparison of assemblers This is an incomplete comparison of Assembler (computing), assemblers. Some assemblers are components of a compiler system for a high-level programming language and may have limited or no usable functionality outside of the compiler system. Some a ...


References


External links

*
Masm32 project
{{Authority control 1981 software Assemblers Macro Assembler DOS software Programming tools for Windows