关于__asm__ __volatile ( )的问题
__asm__ __volatile ( " <-----L 241
pushl %%ebx
pushfl
popl %%eax
movl %%eax, %%ebx
xorl $0x200000, %%eax
pushl %%eax
popfl
pushfl
popl %%eax
xorl %%ebx, %%eax
andl $0x200000, %%eax
jz jumphere
xorl %%eax, %%eax
cpuid
or %%eax, %%eax
jz jumphere
movl $1, %%eax
cpuid
movl %%eax, %%ecx
andl $0xf00, %%ecx
shrl $8, %%ecx
movl %%ecx, %0
movl %%eax, %%ecx
andl $0xf0, %%ecx
shrl $4, %%ecx
movl %%ecx, %1
movl %%eax, %%ecx
andl $0x0f, %%ecx
movl %%ecx, %2
movl %%edx, %%eax
andl $0x800000, %%eax
jz jumphere
mov $1, %%eax
mov %%eax, %3
movl %%edx, %%eax
and $0x2000000, %%eax
mov %%eax, %4
movl %%edx, %%eax
and $0x4000000, %%eax
mov %%eax, %5
jumphere:
popl %%ebx
" <-------L 284
: "=m " (family), "=m " (model), "=m " (stepping), "=m " (has_mmx), "=m " (has_kni), "=m " (has_sse2)
: /*no input*/
: "eax ", "ebx ", "ecx ", "edx "
);
编译的时候提示这里出错
错误信息:
cdeclib/rvcpu.c: In function `RV_Identify_CPU ':
cdeclib/rvcpu.c:241: error: missing terminating " character
cdeclib/rvcpu.c:242: error: `pushl ' undeclared (first use in this function)
cdeclib/rvcpu.c:242: error: (Each undeclared identifier is reported only once
cdeclib/rvcpu.c:242: error: for each function it appears in.)
cdeclib/rvcpu.c:242: error: syntax error before '% ' token
cdeclib/rvcpu.c:284: error: missing terminating " character
哪位兄弟姐妹知道?为什么 等待中T_T
[解决办法]
...每一行都要加\n\t在后面,再用双引号括起整句,然后再看其他错误
[解决办法]
241行结尾加 \
242-283 结尾加 \n\t \
或每行结尾加 \n\t 然后双引号包括每行。
clobber ebx错的话,把第三个:里面的ebx去掉