当我尝试在Visual Studio中编译此代码时,在第13行的':'处出现错误,并显示“ expected a')'”
#include<stdio.h>
int increase(int x)
{
int y;
asm
(
" movl %[x], %%eax \n"
" add $0x01, %%eax \n"
" movl %%eax, %[y] \n"
" jmp done \n"
" done: nop \n"
: [y] "=m" (y) //Error
: [x] "m" (x)
: "eax"
);
return y;
}
int main()
{
int i = 5;
printf("Original i value = %d\n", i);
i = increase(i);
printf("Using the Assembly code: new i value = %d\n", i);
}
答案 0 :(得分:0)
Dude Visual Studio不支持此asm