Dmitry Telenkov 2 일 전
부모
커밋
ff8095c41e
4개의 변경된 파일27개의 추가작업 그리고 11개의 파일을 삭제
  1. 0 11
      asm/print.asm
  2. BIN
      asm/print.exe
  3. BIN
      asm/print.o
  4. 27 0
      asm/print.s

+ 0 - 11
asm/print.asm

@@ -1,11 +0,0 @@
-    .file "print.asm"
-    .text
-    .global print
-
-print:
-    movq $1, %rax
-    movq $1, %rdi
-    leaq str(%rip), %rsi
-    movq $5, %rdx
-    syscall
-    ret

BIN
asm/print.exe


BIN
asm/print.o


+ 27 - 0
asm/print.s

@@ -0,0 +1,27 @@
+    .file "print.s"
+    .text
+    .data
+str:
+    .ascii "test\n"
+    .text
+    .global main
+main:
+    endbr64
+    movq %rsp, %rbp
+
+    movq $0, %rax
+    leaq str(%rip), %rdi
+    movq $5, %rsi 
+    callq print
+    
+    movq %rbp, %rsp
+    movl $0, %eax
+    ret
+
+print:
+    movq %rsi, %rdx
+    movq %rdi, %rsi
+    movq $1, %rdi
+    movq $1, %rax
+    syscall
+    retq