解决方案 »
- 请教关于测试文件读写效率的问题?
- 《Windows程序设计(第五版)》的珍藏版和上下册版我该选哪一版
- 关于打开文件的编程
- 关于SCROLLBARINFO 结构问题
- 请问如何在标题栏上放置下拉式菜单栏或者实现下拉式菜单的效果
- 如何提取一个字符串的前几位啊?
- 执行CoGetClassObject()时,客户端程序报错是怎么回事,DllGetClassObject()函数隐含调用成功
- 为什么创建这样创建位图显示不出来
- 在CVIEW里显示一幅图片,但最大化窗口后就没了,怎样让图片一直在?
- 请教一个MFC使用的简单问题。
- 如何把已经成功运行的"同一机器的进程外COM",转化成"不同机器的进程外COM" ???
- 请教动态库中创建非模式对话框的问题!
MyIE 地址 共创软件联盟
MyICQ 地址 共创软件联盟
MySql 地址 不清楚
Linux内核 地址 不清楚
菲尔防火墙 地址 花钱买
use ASM and CPP together:
1. create an ASM file
;;;;;;;;;;;;; asmsrc.asm:
.386
.model flat, stdcall
option casemap :none
.codemyasmproc proc dw1:DWORD,dw2:DWORD
mov eax,dw1
add eax,dw2
ret
myasmproc endp
end
;;;;;;;;;;;;end of asmsrc.asm2. create a VC project name: useasm, type console application, A "Hello World" application3. move the asm file to your project directory, then in VC project menu->Add to Project...->Files...
Files of type change to "all files", then you can select the asmsrc.asm, and click OK4.in workspace window, FileView tab, select asmsrc.asm, right click to select "settings..." menu, custom build tab, put the following in commands edit box :
d:\masm32\bin\ml.exe /nologo /coff /Zf /c /Sa $(InputName).asm
put the following in Outputs edit box:
$(InputName).obj5.edit your useasm.cpp as the following:
//////////////////////useasm.cpp///////////////////////////////
#include "stdafx.h"
#include <windows.h>
extern "C" int __stdcall myasmproc(DWORD d1,DWORD d2);
int main(int argc, char* argv[])
{
printf("test of using cpp and asm together, if it works, it is done by masterz,otherwise I don't know who write this^_^\n");
int ret=myasmproc(22,33);
printf("ASM result:%d\n",ret);
return 0;
}//////////////////////end of useasm.cpp///////////////////////////////6. build the project and run it, it works.notes: I assume you have installed masm32V6(you can get it from http://www.movsd.com/masmdl.htm) at D:\masm32--------------------------------------------------------------------------------