Chinaunix
标题:
gcc 段寄存器传值 core
[打印本页]
作者:
tom916
时间:
2016-05-30 10:06
标题:
gcc 段寄存器传值 core
#include <stdio.h>
void main(){
int result1 = 0;
int result2 = 0;
int i = 1;
__asm__ __volatile__ ("mov %%gs:%P1 , %%eax" :"=a"(result1) :"n"(1));
//为啥运行到这里就 core
__asm__ __volatile__ ("mov %%gs:%P1,%0" :"=a"(result2) :"m"(i));
printf("Result: %x %x \n", result1,result2);
}
复制代码
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2