Bora vê
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

final.fasm 563B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. format ELF64 executable 3
  2. segment readable executable
  3. entry main
  4. main:
  5. lea rdi, [msg0]
  6. mov rax, 20
  7. mov rdx, rax
  8. mov rsi, rdi
  9. mov rdi, 1
  10. mov rax, 1
  11. syscall
  12. lea rdi, [msg1]
  13. mov rax, 2
  14. mov rdx, rax
  15. mov rsi, rdi
  16. mov rdi, 1
  17. mov rax, 1
  18. syscall
  19. lea rdi, [msg2]
  20. mov rax, 14
  21. mov rdx, rax
  22. mov rsi, rdi
  23. mov rdi, 1
  24. mov rax, 1
  25. syscall
  26. lea rdi, [msg3]
  27. mov rax, 3
  28. mov rdx, rax
  29. mov rsi, rdi
  30. mov rdi, 1
  31. mov rax, 1
  32. syscall
  33. xor rdi,rdi
  34. mov rax, 60
  35. syscall
  36. segment readable writable
  37. msg0 db 'Escreva um numero:', 10,0
  38. msg1 db 'a', 10,0
  39. msg2 db 'fatorial de:', 10,0
  40. msg3 db '\n', 10,0