Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Microsoft Macro Assembler
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Assembler for Intel microprocessors}} {{Infobox software | name = Microsoft Macro Assembler | logo = | developer = [[Microsoft]] | released = {{Start date and age|1981}} | latest_release_version = 14.16.27023.1 | latest_release_date = {{Start date and age|2017|03|07}} | operating_system = [[Microsoft Windows]] and [[MS-DOS]] | genre = [[Assembly language assembler|Assembler]] | license = [[Commercial software|Commercial]] [[proprietary software]] | website = {{URL|https://docs.microsoft.com/en-us/cpp/assembler/masm/microsoft-macro-assembler-reference}} }} '''Microsoft Macro Assembler''' ('''MASM''') is an [[X86 architecture|x86]] [[Assembly language assembler|assembler]] that uses the [[X86 assembly language|Intel syntax]] for [[MS-DOS]] and [[Microsoft Windows]]. 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. MASM is maintained by [[Microsoft]], but since version 6.12 it has not been sold as a separate product. It is instead supplied with various Microsoft [[Software development kit|SDKs]] and [[C (programming language)|C]] [[compiler]]s. Recent versions of MASM are included with [[Microsoft Visual Studio]]. Notable applications compiled using MASM are [[RollerCoaster Tycoon (video game)|RollerCoaster Tycoon]] which was 99% written in assembly language and built with MASM.<ref>{{Cite web |title=Chris Sawyer Software Development |url=https://www.chrissawyergames.com/faq3.htm |url-status=live |archive-url=https://web.archive.org/web/20250307201109/https://www.chrissawyergames.com/faq3.htm |archive-date=2025-03-07 |access-date=2023-01-05 |website=www.chrissawyergames.com |language=en-US}}</ref> ==History== The earliest versions of MASM date back to 1981.<ref name = "InfoWorld Jan 1985">{{Cite magazine | last = Watt | first = Peggy |author2=Christine McGeever | title = Macintosh Vs. IBM PC At One Year |magazine= InfoWorld | volume = 7 | issue = 1 | pages =15β16 | date = January 7, 1985 | url = https://books.google.com/books?id=-i4EAAAAMBAJ&pg=PA16 | issn = 0199-6649}} The IBM PC Macro Assembler was released in December 1981.</ref> They were sold either as the generic "Microsoft Macro Assembler" for all x86 machines or as the OEM version specifically for [[IBM PC]]s. 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. MS-DOS versions up to 4.x included Microsoft's LINK utility, which was designed to convert intermediate [[Relocatable Object Module Format|OBJ file]]s 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 [[i286|286]] instructions. Version 5.0, released August 1987, supported [[i386|386]] 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]] application only. Versions 5.1 and 6.0 were available as both [[MS-DOS]] and [[OS/2]] applications.<ref name = "InfoWorld Apr 1991">{{Cite magazine | last = Marshall | first = Martin | title = Macro Assembler Update Adds High-Level Features |magazine= InfoWorld | volume = 13 | issue = 17 | page =21 | date = April 29, 1991 | url = https://books.google.com/books?id=y1AEAAAAMBAJ&pg=PT20 | issn = 0199-6649}}</ref> 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 [[record (computer science)|record]]s, among other things. Both 6.0 and 6.0B were able to be run on an [[8086]] 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]], 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.<ref name="Microsoft KB Q94314">{{cite web |title=Q94314: 32-Bit Flat Memory Model MASM Code for Windows NT |url=https://jeffpar.github.io/kbarchive/kb/094/Q94314/ |url-status=dead |archive-url=https://web.archive.org/web/20210113091943/https://jeffpar.github.io/kbarchive/kb/094/Q94314/ |archive-date=13 January 2021 |access-date=3 October 2023}}</ref> In 1993 full support for protected mode 32-bit applications and the [[Intel P5 (microarchitecture)|Pentium]] instruction set was added. The 6.11 MASM binary at that time (1993) was shipped as a "bi-modal" (win32, i.e. [[Portable Executable|PE]]) DOS-extended binary (using the [[Phar Lap (company)|Phar Lap]] 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 [[file compression|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 [[Patch (computing)|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]] and included some [[AMD]]-specific instructions.<ref name="harvey">{{cite web |author=R. E. Harvey |year=2007 |title=Assemblers |url=http://ourworld.compuserve.com/homepages/r_harvey/doc_book.htm |url-status=dead |archive-url=https://web.archive.org/web/20080216121237/http://ourworld.compuserve.com/homepages/r_harvey/doc_book.htm |archive-date=16 February 2008 |access-date=4 February 2010}}</ref> In 1999, Intel released macros for [[SIMD]] and [[MMX (instruction set)|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]] toolset. Though it was still compatible with [[Windows 98]], current versions of Visual Studio were not.<ref name="harvey" /> Support for 64-bit processors was not added until the release of [[Visual Studio 2005]], 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 [[Relocatable Object Module Format|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]]<ref>{{cite web|url=http://download.microsoft.com/download/e/b/a/eba1050f-a31d-436b-9281-92cdfeae4b45/pecoff.doc |title=Archived copy |access-date=2008-06-24 |url-status=dead |archive-url=https://web.archive.org/web/20090126141159/http://download.microsoft.com/download/e/b/a/eba1050f-a31d-436b-9281-92cdfeae4b45/pecoff.doc |archive-date=2009-01-26 }}</ref><ref>{{cite web|url=https://www.microsoft.com/en-us/download/details.aspx?id=19509|title=WHDC White Papers and Documentation|website=[[Microsoft]]|access-date=25 September 2016}}</ref> (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]], later owned by Embarcadero, last updated in 2002, but still supplied with [[C++Builder]] and [https://www.embarcadero.com/products/rad-studio RAD Studio]. * [[JWasm]] Macro Assembler, licensed under the Sybase Open Watcom [[EULA]]. Last updated in 2014. * Pelle's Macro Assembler, a component of the [https://www.pellesc.de/ Pelles C] {{Webarchive|url=https://web.archive.org/web/20200229173403/https://www.pellesc.de/ |date=2020-02-29 }} development environment. * [http://www.terraspace.co.uk/uasm.html UASM] is a free MASM-compatible assembler based on JWasm. * [https://github.com/nidud/asmc 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]], C, [[FORTRAN]], [[Pascal (programming language)|Pascal]]."<ref>{{cite book |title=Microsoft Macro Assembler 5.1, Mixed-Language Programming Guide |page=3}}</ref> ==Reception== In a review of three assemblers, Michael Blaszczak of ''[[BYTE (magazine)|BYTE]]'' 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".<ref name="blaszczak198902">{{Cite magazine |last=Blaszczak |first=Michael |date=February 1989 |title=Three Assemblers for MS-DOS |url=https://archive.org/details/eu_BYTE-1989-02_OCR/page/n260/mode/1up?view=theater |access-date=2024-10-08 |magazine=BYTE |pages=205-209}}</ref> ==See also== * [[Microsoft MACRO-80]] * [[Assembly language]] * [[High-level assembler]] * [[Comparison of assemblers]] ==References== {{Reflist}} ==External links== * {{Official website|https://docs.microsoft.com/en-us/cpp/assembler/masm/microsoft-macro-assembler-reference}} * [https://www.masm32.com Masm32 project] {{Microsoft development tools}} {{X86 assembly topics}} {{Authority control}} [[Category:1981 software]] [[Category:Assemblers]] [[Category:Microsoft development tools|Macro Assembler]] [[Category:DOS software]] [[Category:Programming tools for Windows]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:Cite book
(
edit
)
Template:Cite magazine
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main other
(
edit
)
Template:Microsoft development tools
(
edit
)
Template:Official website
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)
Template:Webarchive
(
edit
)
Template:X86 assembly topics
(
edit
)