cradleasm8.asm 450 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [BITS 64]
  2. ; begining of the assembly program
  3. ; sys calls
  4. %define SYS_EXIT 60
  5. %define SYS_WRITE 1
  6. %define STD_IN 0
  7. %define STD_OUT 1
  8. %define STD_ERR 2
  9. section .bss
  10. ; nada
  11. section .data
  12. section .text
  13. global _start
  14. _start:
  15. xor rax, rax
  16. push rax
  17. mov rax,8
  18. push rax
  19. mov rax,7
  20. push rax
  21. mov rax,9
  22. pop rbx
  23. sub rax, rbx
  24. neg rax
  25. pop rbx
  26. imul rax, rbx
  27. pop rbx
  28. sub rax, rbx
  29. neg rax
  30. ; end of program
  31. mov rdi,rax
  32. mov rax,SYS_EXIT
  33. syscall