|
#include <iostream>
using namespace std;
int a = 10;
int b = 20;
int result;
int main()
{
asm ( "pusha\n\t"
"movl a, %eax\n\t"
"movl b, %ebx\n\t"
"imull %ebx, %eax\n\t"
"movl %eax, result\n\t"
"popa");
cout<<"the answer is "<< result <<endl;
return 0;
}
上面是完整的源程序,我是在FC4系统下编译,gcc版本为4.0.0.
请教高手:为什么用gcc生成可执行文件时会出错呢? |
|