Advertisement
Coriic

Untitled

May 29th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. .data
  2. s:
  3. .byte 0
  4.  
  5. .type generate_str,@function
  6. .global generate_str
  7. #rdi->rsi->rdx->rcx
  8.  
  9. generate_str:
  10. MOV %rdi, s
  11. CMP $0, %rcx
  12. JE theSameLetter
  13. JMP changeLetter
  14.  
  15. theSameLetter:
  16. CMP $0, %rdx
  17. JE exit
  18. MOV %rsi, (%rdi)
  19. INC %rdi
  20. DEC %rdx
  21. JMP theSameLetter
  22.  
  23. changeLetter
  24. CMP $0, %rdx
  25. JE exit
  26. MOV %rsi, (%rdi)
  27. INC %rsi
  28. INC %rdi
  29. DEC %rdx
  30. JMP changeLetter
  31.  
  32. exit:
  33. MOV s, %rax
  34. RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement