下载:http://www.masm32.com/
安装masm32
建一个Var.bat文件并运行
@echo off
set include=E:\masm32\include
set lib=E:\masm32\lib
set path=E:\masm32\bin;%path%
echo on
test.asm程序源文件放置于E:\Source\test下
.386 .model flat,stdcall option casemap:none ;include文件 include windows.inc include user32.inc includelib user32.lib include kernel32.inc includelib kernel32.lib ;数据段 .data szCaption db ‘MessageBox!‘,0 szText db ‘Hello,World!‘,0 ;代码段 .code start: invoke MessageBox,NULL, offset szText, offset szCaption, MB_OK invoke ExitProcess,NULL end start
dos下运行
ml /c /coff 1.asm(编译)
link /subsystem:windows 1.obj(链接) 命令
出现错误
缺少user32.lib
直接VC下lib目录下文件全拷贝到masm32的lib目录下
运行生成的exe文件:
时间: 2024-10-07 14:20:30