2. To congfigure on Visual Studio 2008
1 . To configure on Visual Studio 2010
x86 processor:
The visual studio 2010 will supports to build assembly code for x86 processor by macro ."_asm"
#include <Windows.h> #include <iostream> using namespace std; int GetValue() { _asm { mov eax ,100; } } int main() { cout<<" Call ASM :"<< GetValue()<<endl; return 0; }
x64 processor :
picture 1:
Picture 2 :
Picture 3 :
Picture 4 :
Picture5
- #include <iostream>using namespace std;extern "C" int getValueFromASM();#include <conio.h>int main(){cout<<" Assembly :" << getValueFromASM()<<endl;_getch();return 0;}
- .codegetValueFromASM procMOV eax , 2783retgetValueFromASM endpend
2. To congfigure on Visual Studio 2008 (Run as Admin)
resource :link instruction
x64 processor
Picture 1 :
Picture 2 :
Run Admin Picture 3 :
Picture 4:
ThongLT 3/6/2013 Ho Chi Minh City
No comments:
Post a Comment