下面是在C语言中嵌入汇编的例子,下面是三点要注意的~
#include<iostream>
#include<windows.h>
#include<tchar.h>
using namespace std;
int _tmain(int argc, _TCHAR * argv[])
{
int data1=0x000000;
int data2=0x00000F;
int sum;
_asm{
mov eax,data1
mov ebx,data2
add eax,ebx
mov sum,eax
}
cout<<sum;
getchar();
return 0;
}