0

When I try to compile this code in Visual Studio, I get error at ':' on line 13, and it says "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);
}
user4581301
  • 33,082
  • 7
  • 33
  • 54

1 Answers1

0

Dude Visual Studio doesn't support this asm

Imali.bh
  • 1
  • 1