summaryrefslogtreecommitdiffstats
path: root/asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'asm.c')
-rw-r--r--asm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/asm.c b/asm.c
new file mode 100644
index 0000000..301a767
--- /dev/null
+++ b/asm.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ int i = 12;
+
+ asm(".att_syntax prefix");
+ asm("movl %0, %%eax\n" : : "r" (i) : "eax");
+ printf("i is: %d\n", i);
+
+ return 0;
+}
+