Skip to content

Instantly share code, notes, and snippets.

@drnickallgood
Last active January 15, 2016 01:55
Show Gist options
  • Save drnickallgood/72eee5d9989ca1ccc149 to your computer and use it in GitHub Desktop.
Save drnickallgood/72eee5d9989ca1ccc149 to your computer and use it in GitHub Desktop.
global start
section .data
prompt db "Enter Something... "
section .bss
buffer: resw 4
outstring: resw 4
section .text
start:
mov rax, 0x2000004 ; sys write
mov rdi, 1 ; stdout
mov rsi, prompt ; address of prompt
mov rdx, 32
syscall
mov rax, 0x2000003 ; sys read
mov rdi, 0 ; stdin
mov rsi, buffer
mov rdx, 32
syscall
mov rax, 0x200004
mov rdi, 1
mov rsi, buffer
mov rdx, 32
syscall
mov rax, 0x200001 ;sys exit
mov rdi, 0 ; clean exit
syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment