diff --git a/.gitignore b/.gitignore index 579ea38..5a20b8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ *.o -main -derle \ No newline at end of file +main* \ No newline at end of file diff --git a/004-get_input.s b/004-get_input.s new file mode 100644 index 0000000..95bd9ba --- /dev/null +++ b/004-get_input.s @@ -0,0 +1,36 @@ +.global _start +.intel_syntax noprefix + +.data + buffer: + .byte 0x00 +.text + _start: + + //hello world + mov rax, 1 + mov rdi, 1 + lea rsi, [hello_world] + mov rdx, 13 + syscall + + //get intput + mov rax, 0 + mov rdi, 0 + lea rsi, [buffer] + mov rdx, 1 + syscall + + //print input + mov rax, 1 + mov rdi, 1 + lea rsi, [buffer] + mov rdx, 3 + syscall + + //exit + mov rax, 60 + syscall + + hello_world: + .asciz "Hello World\n" diff --git a/compile b/compile new file mode 100755 index 0000000..921ed78 --- /dev/null +++ b/compile @@ -0,0 +1,4 @@ +#!/bin/bash +as main.s -o main.o +gcc main.o -o main -nostdlib -static +./main