Dmitry Telenkov 2 天之前
父节点
当前提交
af2337ac76
共有 1 个文件被更改,包括 29 次插入0 次删除
  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