Last active
December 10, 2015 12:28
-
-
Save warabanshi/4434217 to your computer and use it in GitHub Desktop.
read character from stdin and write stdout by system call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.intel_syntax noprefix | |
.comm mem, 30000 | |
.globl main | |
main: | |
lea rbx, mem | |
# read systemcall | |
mov rax, 0 # specify read system call | |
mov edx, 0x1 # 3nd argument (count) | |
mov rsi, rbx # 2nd argument (string pointer) | |
mov edi, 0x0 # 1st argument (stdout) | |
syscall | |
# write systemcall | |
mov rax, 1 # specify write system call | |
mov edx, 0x1 # 3nd argument (count) | |
mov rsi, rbx # 2nd argument (string pointer) | |
mov edi, 0x1 # 1st argument (stdout) | |
syscall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment