Advertisement
Guest User

Untitled

a guest
Dec 20th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. DEFAULT REL
  2.  
  3. section .rodata
  4. string1 db "One for "
  5. len1 equ $ - string1
  6. string2 db ", one for me.", 0
  7. len2 equ $ - string2
  8.  
  9. section .text
  10. global two_fer
  11. two_fer:
  12. mov rax, rdi
  13. mov rbx, rsi
  14.  
  15. xor rdi, rdi
  16.  
  17. lea rsi, [string1]
  18. lea rdi, [rbx]
  19. mov rcx, len1
  20. rep movsb
  21.  
  22. xor dl, dl
  23. xor rcx, rcx
  24. _label:
  25. cmp byte [rax], 0
  26. je _exit
  27. add rcx, 1
  28. jmp _label
  29.  
  30. _exit:
  31. mov rcx, rax
  32. lea rsi, [rax]
  33. lea rdi, [rbx + len1]
  34. rep movsb
  35.  
  36. lea rsi, [string2]
  37. lea rdi, [rbx + len1 + rax]
  38. mov rcx, len2
  39. rep movsb
  40.  
  41. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement