Dmitry Telenkov il y a 3 jours
Parent
commit
af2337ac76
1 fichiers modifiés avec 29 ajouts et 0 suppressions
  1. 29 0
      asm/test_8.asm

+ 29 - 0
asm/test_8.asm

@@ -0,0 +1,29 @@
+    .file "test_8.asm"
+    .data
+str:
+    .ascii "test\n"
+    .text
+    .global _start
+_start:
+    movq %rsp, %rbp
+    call print
+    movq %rbp, %rsp
+
+    // exit
+    movq $60, %rax
+    movq $0, %rdi
+    syscall
+
+
+print:  
+    movq $1, %rax
+    movq $1, %rdi
+    leaq str(%rip), %rsi
+    movq $5, %rdx
+    syscall
+    ret
+
+    // exit
+    movq $60, %rax
+    movq $0, %rdi
+    syscall