Ladies_Man

#ccc hallo read and write

Dec 18th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #.intel_syntax noprefix
  2.  
  3. .data                                
  4. msg:
  5.     .ascii "hello"
  6.     .set len, .-msg
  7.    
  8. .bss           #Uninitialized data
  9.    .lcomm num, 5
  10.    
  11. .text          
  12. .global _start
  13.    
  14. _start:
  15.    xorq %rax, %rax
  16.    xorq %rdi, %rdi
  17.    movq $num, %rsi  
  18.    movq $5, %rdx   #5 bytes (numeric, 1 for sign)
  19.                 #of that information
  20.    syscall
  21.    
  22.    movq $1, %rax
  23.    movq $1, %rdi
  24.    movq $num, %rsi
  25.    movq $len, %rdx
  26.    syscall
  27.    
  28.    movq $60, %rax
  29.    xorq %rdi, %rdi
  30.    syscall
Advertisement
Add Comment
Please, Sign In to add comment