我在我的 Windows XP SP3 机器上安装了 masm32。我从这里下载了 masm32:
http://www.masm32.com/masmdl.htm
安装它。我将路径 C:\masm32\bin 添加到 PATH 环境变量中。现在,我正在尝试组装和链接一个示例程序。它创建目标文件但不创建可执行文件。
示例程序:
include \masm32\include\masm32rt.inc
.data
MyTitle db "ASM!",0
MyText db "Some Text!",0
.code
start:
push 0
push offset MyTitle
push offset MyText
push 0
call MessageBoxA
call ExitProcess
end start
另外,请注意 c:\masm32\bin 目录中的默认 link.exe 文件在链接时抛出错误,如下所示:
Assembling: sample.asm
***********
ASCII build
***********
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"sample.obj+"
"sample.obj"
"sample.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : fatal error LNK1181: cannot open input file "sample.obj+"
我从这里得到了另一个版本的 link.exe:
http://download.microsoft.com/download/vc15/Update/1/WIN98/EN-US/Lnk563.exe
当我使用以下命令组装和链接时:
ml.exe sample.asm sample.obj
它给出了错误:
Assembling: sample.asm
***********
ASCII build
***********
Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
Object Modules [.obj]: sample.obj+
Object Modules [.obj]: "sample.obj"
Run File [sample.exe]: "sample.exe"
List File [nul.map]: NUL
Libraries [.lib]:
Definitions File [nul.def]:
LINK : fatal error L1104: \masm32\lib\masm32.lib : not valid library