c语言的嵌入汇编的一个问题,高分,请高手进入,不够再加分
在一段linux下的代码中有这样一段
#elif i386
asm(" .text
.align 8
.globl _get_sw,__get_sw
__get_sw:
_get_sw:
pushl %ebp
movl %esp,%ebp
movl $0,%eax
fnstsw %ax
movl %ebp,%esp
popl %ebp
ret
.align 8
.globl _get_cw,__get_cw
__get_cw:
_get_cw:
pushl %ebp
movl %esp,%ebp
subw $2,%esp
fnstcw -2(%ebp)
movw -2(%ebp),%eax
movl %ebp,%esp
popl %ebp
ret
");
#else
不知道是什么意思,请高手解释一下。另外怎样才能在VC下编译通过,VC出了一堆错误
error C2143: syntax error : missing ';' before '__asm'
error C2001: newline in constant
error C2501: '_get_sw' : missing storage-class or type specifiers
error C2239: unexpected token ':' following declaration of '_get_sw'
error C2059: syntax error : '%'
error C2001: newline in constant
#warning no fpu trap support for this target
#endif
谢谢高手能给予指点