windows masm32 和 masm 的区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4075870/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:31:36  来源:igfitidea点击:

Difference between masm32 and masm?

windowsprogramming-languagesmasmassembly

提问by Jumbo

I am trying to learn assembly for windows and see that there are 2 assemblers:

我正在尝试学习 windows 的汇编,并看到有 2 个汇编程序:

masm : https://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64

masm : https://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64

masm32 : http://masm32.com/index.htm

masm32:http: //masm32.com/index.htm

are these equivalent? which one should i choose to learn assembly for windows?

这些是等价的吗?我应该选择哪一个来学习 windows 的汇编?

回答by Fabian Giesen

It's both MASM (apparently), just different versions. I'd normally use the official (MS) link. MASM is also part of the Windows SDK now - if you install it, it contains ML.exein the bindirectory.

它都是 MASM(显然),只是版本不同。我通常会使用官方 (MS) 链接。MASM 现在也是 Windows SDK 的一部分 - 如果您安装它,它包含ML.exebin目录中。

If you're just using it to learn assembly language, the MASM version used doesn't make much of a difference. Newer versions of MASM add support for 64 bits (ML64.exe) and newer instructions as they get added to the x86 instruction set, but that's about it. The main differences between different assemblers are the different dialects. There's 3 main dialects of x86 assembly language: MASM syntax, NASM syntax and Unix-style assyntax (there also used to be Borland TASM, but that's pretty much dead nowadays). MASM, NASM and YASM all use the same instruction and register names but have some slightly differing conventions (dword ptr [blah]vs. dword [blah]etc.) and quite different macro languages. MASM also has some higher-level constructs like .if/ .endif, invokeetc. that don't exist in other Assemblers. Whether that's an advantage or not is a matter of taste, I personally prefer the NASM style syntax because it's more regular and I find the macro preprocessor more convenient to use, but that's a matter of taste.

如果你只是用它来学习汇编语言,使用的 MASM 版本没有太大区别。较新版本的 MASM 添加了对 64 位 ( ML64.exe) 和较新指令的支持,因为它们被添加到 x86 指令集中,但仅此而已。不同汇编程序之间的主要区别是不同的方言。x86 汇编语言有 3 种主要方言:MASM 语法、NASM 语法和 Unix 风格的as语法(以前也有 Borland TASM,但现在几乎已经死了)。MASM、NASM 和 YASM 都使用相同的指令和寄存器名称,但有一些略有不同的约定(dword ptr [blah]vs.dword [blah]等)和完全不同的宏语言。MASM 也有一些更高级的结构,比如.if/ .endifinvoke其他汇编程序中不存在的等。无论这是否是一个优势,这是一个品味问题,我个人更喜欢 NASM 风格的语法,因为它更规则,而且我发现宏预处理器使用起来更方便,但这是一个品味问题。

asis a different matter. It uses a completely different syntax and instruction names that differ from what's given in the Intel manuals. It's the default on most Unix variants (and also in compilers that come from that environment, e.g. GCC) but basically unused outside that environment. Current versions of GNU assupport Intel syntax too, which makes most of the syntactic differences go away, but asin general is mainly intended as a backend assembler for compilers and not a fullly-fledged macro assembler, so it still has a very limited featureset compared to MASM or NASM/YASM.

as是另一回事。它使用与 Intel 手册中给出的完全不同的语法和指令名称。它是大多数 Unix 变体(以及来自该环境的编译器,例如 GCC)的默认设置,但在该环境之外基本上未使用。当前版本的 GNU 也as支持 Intel 语法,这使得大部分语法差异都消失了,但as总的来说,它主要用作编译器的后端汇编程序,而不是成熟的宏汇编程序,因此与MASM 或 NASM/YASM。

回答by joni

As it seems, MASM32 is a whole SDK with editor etc. What you can download hereis just the assembler itself for use together with Visual C++ 2005 Express Edition (read under "System requirements"). So if you wanna start just from zero, download the MASM32 Sdk which is, as far as I guess, better suited for beginners. Just read thispage here to get more information about MASM.

看起来,MASM32 是一个带有编辑器等的完整 SDK。您可以在此处下载的只是与 Visual C++ 2005 Express Edition 一起使用的汇编器本身(在“系统要求”下阅读)。因此,如果您只想从零开始,请下载 MASM32 Sdk,据我所知,它更适合初学者。只需在此处阅读页面即可获取有关 MASM 的更多信息。

回答by ahouse101

MASM32 is an entire SDK, like joni said. It contains an editor, some help files, and basically everything you need to code in the MASM language. Also, it's worth noting that MASM32 does indeed contain version 8 of MASM; you're not missing anything. I personally recommend MASM32 as a package, it makes starting off in MASM much easier, but you can do it all from scratch and use just the original MASM assembler and figure it out from there.

正如 joni 所说,MASM32 是一个完整的 SDK。它包含一个编辑器、一些帮助文件,以及用 MASM 语言编写代码所需的基本上所有内容。另外,值得注意的是 MASM32 确实包含 MASM 的第 8 版;你没有错过任何东西。我个人推荐 MASM32 作为一个包,它使在 MASM 中开始更容易,但是你可以从头开始做这一切,只使用原始的 MASM 汇编程序并从那里弄清楚。