fork download
  1. #include <stdio.h>
  2.  
  3. main()
  4. {
  5. int x = 100, y = 500;
  6.  
  7. __asm{
  8. mov eax, x
  9. xchg eax, y
  10. mov x, eax
  11. }
  12. printf("%d %d\n", x, y);
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:1: warning: return type defaults to ‘int’ [-Wreturn-type]
 main()
 ^
prog.c: In function ‘main’:
prog.c:7:10: error: expected ‘(’ before ‘{’ token
     __asm{
          ^
prog.c:8:13: error: unknown type name ‘mov’
             mov eax, x
             ^
prog.c:9:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘xchg’
             xchg eax, y
             ^
prog.c:8:17: warning: unused variable ‘eax’ [-Wunused-variable]
             mov eax, x
                 ^
prog.c:13:1: error: expected declaration or statement at end of input
 }
 ^
prog.c:13:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty