2015-03-10 21:09:43 +08:00
|
|
|
void inline ex1(void){
|
2015-04-01 11:49:42 +08:00
|
|
|
asm ("movl $0xffff, %eax\n");
|
2015-03-10 21:09:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void inline ex2(void){
|
|
|
|
unsigned cr0;
|
|
|
|
asm volatile ("movl %%cr0, %0\n" :"=r"(cr0));
|
|
|
|
cr0 |= 0x80000000;
|
|
|
|
asm volatile ("movl %0, %%cr0\n" ::"r"(cr0));
|
|
|
|
}
|
|
|
|
|
|
|
|
void inline ex3(void){
|
|
|
|
long __res, arg1 = 2, arg2 = 22, arg3 = 222, arg4 = 233;
|
|
|
|
__asm__ __volatile__("int $0x80"
|
|
|
|
: "=a" (__res)
|
|
|
|
: "0" (11),"b" (arg1),"c" (arg2),"d" (arg3),"S" (arg4));
|
|
|
|
}
|