diff --git a/printf/hello.asm b/printf/hello.asm index 6b0f071..66763dc 100644 --- a/printf/hello.asm +++ b/printf/hello.asm @@ -17,24 +17,49 @@ main: syscall ;invoke ; ^^^^ is the linux syscall way of printing a string + + + + mov r8b, [text] add r8b, 1 mov [text], r8b - - - - mov rdi, text + mov rdi, text cld call puts ;this is the put s way of printing a string - add rsp, 8 - ret + + + mov r8b, [text+3] ;14 + sub r8b, 16 + mov [text+3], r8b + + mov r8b, [text+2] + sub r8b, 16 + mov [text+2], r8b + + mov r8b, [text+4] + sub r8b, 10 + mov [text+4], r8b + + mov r8b, [text] + add r8b, 4 + mov [text], r8b + + mov rdi, text + cld + call puts ;this is the put s way of printing a string + + _end: - mov rax, 60 ; exit - mov edi, 1 ; error 1 - syscall + add rsp, 8 + ret + +; mov rax, 60 ; exit +; mov edi, 1 ; error 1 dont need the exit anymore beacue libc or somthing +; syscall diff --git a/printf/hello.o b/printf/hello.o deleted file mode 100644 index c3f4ec9..0000000 Binary files a/printf/hello.o and /dev/null differ