当前位置:Linux教程 - Linux文化 - GCC扩展汇编代码编译出错!不知道原因!?

GCC扩展汇编代码编译出错!不知道原因!?


__asm__ __volatile__ ( "cld\n\t" "rep\n\t" "stosd "

:

:"a"(0),"c"(128),"D"(remain)

:"%eax","%ecx","%edi" ); //function number 出错消息为: recovery.cpp:21: 错误:can't find a register in class ‘CREG’ while reloading ‘asm’

>>> 此贴的回复 >> 试一下把ecx换成edx看看能否编译通过。

>>> 此贴的回复 >> 将 :"%eax","%ecx","%edi" ); //function number改为 :"eax","ecx","edi" ); //function number或者 :%eax,%ecx,%edi ); //function number