c-exercises/test-inline-assembly.c

18 lines
241 B
C
Raw Normal View History

#include <assert.h>
2013-12-08 23:33:05 +01:00
#include <stdio.h>
int main() {
int i = 0xffff;
asm("movl $23, %0"
: "=r" (i) /* output */
/* : no input */
2013-12-08 23:33:20 +01:00
/* : no clobbered */
2013-12-08 23:33:05 +01:00
);
printf("i = %d\n", i);
assert(i == 23);
2013-12-08 23:33:05 +01:00
return 0;
}