VC内联汇编和GCC内联汇编的语法区别 12月 31 2016 编程 几秒 读完 (约 52 字) VC 12345678910111213141516#include <stdio.h>main(){ int a = 1; int b = 2; int c; __asm{ mov eax,a mov ebx,b mov ecx,1h add eax,ebx mov c,ecx } printf("%x\n", c);} GCC 1234567891011121314#include <stdio.h>main(){ int a = 1; int b = 2; int c; asm( "add %2,%0" //1 :"=g"(c) //2 :"0"(a),"g"(b) //3 :"memory" //4 ); printf("%x\n", c);} #Assembly Windows 7、Windows XP SP3关闭DEP堆栈执行保护 VirtualBox导入Vmware生成的vmdk格式虚拟机镜像