VC6调用ASM

//Main.cpp
#include <iostream>
using namespace std;

extern "C" int DoubleIt(int n);

int main(){
	cout<<"Value return by Double It is:"
		<<DoubleIt(2)<<endl;
	return 0;
}

 

.586
.model flat,C
.code
DoubleIt PROC,
inval:DWORD
	mov eax,inval
	add eax,eax
	add eax,eax
	ret
DoubleIt ENDP
END

 

 

posted @ 2012-10-30 00:37  庚武  Views(203)  Comments(0Edit  收藏  举报