IoIiderp

printletters.asm

Apr 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2.     character db 0,10
  3.  
  4. section .bss
  5.     mystr resb 128
  6.  
  7. section .text
  8.     global _start
  9.  
  10. _start:
  11.     mov r8, 0
  12.     call getStr
  13.     call printStrChars
  14.  
  15.     mov rax, 60
  16.     mov rdi, 0
  17.     syscall
  18.  
  19. getStr:
  20.     mov rax, 0
  21.     mov rdi, 0
  22.     mov rsi, mystr
  23.     mov rdx, 128
  24.     syscall
  25.     ret
  26.  
  27. printStrChars:
  28.     add r8, 1
  29.     mov rax, [mystr+r8-1]
  30.     mov [character], al
  31.     mov rax, 1
  32.     mov rdi, 1
  33.     mov rsi, character
  34.     mov rdx, 2
  35.     syscall
  36.     cmp r8, 128
  37.     jne printStrChars
  38.     ret
Advertisement
Add Comment
Please, Sign In to add comment