test_8.asm 384 B

1234567891011121314151617181920212223242526272829
  1. .file "test_8.asm"
  2. .data
  3. str:
  4. .ascii "test\n"
  5. .text
  6. .global _start
  7. _start:
  8. movq %rsp, %rbp
  9. call print
  10. movq %rbp, %rsp
  11. // exit
  12. movq $60, %rax
  13. movq $0, %rdi
  14. syscall
  15. print:
  16. movq $1, %rax
  17. movq $1, %rdi
  18. leaq str(%rip), %rsi
  19. movq $5, %rdx
  20. syscall
  21. ret
  22. // exit
  23. movq $60, %rax
  24. movq $0, %rdi
  25. syscall