本文介绍了包含MASM的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些年来,MASM的使用方式已经发生了大约50倍的变化,因为我发现了很多答案,但没有一个是有效的.

So it would appear how to use MASM has changed about 50 times over the years because I found a huge number of answers and not one of them works.

我想知道的是,您如何在MASM上调用诸如exitprocess之类的东西?我要包含哪些文件/它们在哪里?我正在使用VS2015 Community Edition中内置的ml.exe.我的根驱动器或VS上都没有MASM文件夹.VS没有附带任何.inc文件(我在驱动器上进行了详尽的搜索).我只想做一些简单的事情:

What I'd like to know is how do you call something like exitprocess on MASM? What files do I include/where are they? I'm using the ml.exe built into VS2015 Community Edition. There is no MASM folder on either my root drive or with VS. VS does not come with any .inc files (I ran an exhaustive search on the drive). I just want to do something simple:

.386
.model flat, stdcall 
option casemap:none 
includelib ?????????????
include ?????????????
.data 
.code 
start: 
    invoke ExitProcess,0 
end start

我尝试仅包含msvcrt.lib,但这也不起作用.

I tried including just msvcrt.lib and this also does not work.

推荐答案

希望有人能提供更好的答案,但我通过从此站点安装MASM进行了修复.它将masm32文件夹放在根目录中(对于我们大多数人来说都是C:\)

Hopefully someone has a better answer, but I fixed in by installing MASM from this site. It puts the masm32 folder in the root directory (C:\ for most of us)

http://www.masm32.com/download.htm

而且,.inc文件只是一堆函数原型.因此,您可以将所需的函数原型化,然后使用includelib对其进行调用.

Also, the .inc files are just a bunch of function prototypes. So you could just prototype whatever function you want and then use includelib to call it.

http://win32assembly.programminghorizo​​n.com/tut2.html

.386 
.model flat, stdcall 
option casemap:none 
include C:\masm32\include\windows.inc 
include C:\masm32\include\kernel32.inc 
includelib C:\masm32\lib\kernel32.lib 
.data 
.code 
start: 
    invoke ExitProcess,0 
end start

但是我可以很容易地删除包含内容:

But I could just as easily remove the includes:

.386 
.model flat, stdcall 
option casemap:none
includelib C:\masm32\lib\kernel32.lib 
.data 
.code 
start: 
    ExitProcess PROTO STDCALL :DWORD
    invoke ExitProcess,0 
end start

这篇关于包含MASM的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 15:15