标签:int %x 汇编 区别 SM std asm main span
VC:
#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:
#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);
}
标签:int %x 汇编 区别 SM std asm main span
原文地址:https://www.cnblogs.com/Chorder/p/9114476.html