Advertisement
Guest User

Untitled

a guest
Oct 8th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .globl _start
  2.  
  3. .text
  4. _start:
  5.     mov $1, %rax
  6.     mov $filename, %rdi
  7.     mov $0, %rsi
  8.     syscall
  9.  
  10.     push %rax
  11.     # rax - file descriptor
  12.     mov $0, %rax
  13.     pop %rdi
  14.     mov $buffer, %rdi
  15.     mov $lbuffer, %rdx
  16.     syscall
  17.     push %rax
  18.    
  19.     mov $1, %rax
  20.     mov $1, %rdi
  21.     mov $buffer, %rdi
  22.     pop %rdx
  23.     syscall
  24.  
  25.     mov $60, %rax
  26.     mov $0, %rdi
  27.     syscall
  28.  
  29. .data
  30. filename: .ascii "1.s\0"
  31. buffer: .fill 1000, 1, 0
  32. lbuffer = . - buffer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement