2021-09-07 19:58:21 -04:00
|
|
|
extern puts
|
|
|
|
|
|
|
|
section .data
|
|
|
|
text db "Bottom Text",10,0
|
|
|
|
section .text
|
|
|
|
global main
|
|
|
|
|
|
|
|
main:
|
|
|
|
sub rsp, 8
|
|
|
|
mov r9b, [text]
|
|
|
|
|
|
|
|
|
|
|
|
mov rax, 1 ;syscall 1
|
|
|
|
mov rdi, 1 ; arg 1 (stdout)
|
|
|
|
mov rsi, text ; the shit to print
|
|
|
|
mov rdx, 12 ; the length
|
|
|
|
syscall ;invoke
|
|
|
|
; ^^^^ is the linux syscall way of printing a string
|
|
|
|
|
2021-09-07 21:27:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-07 19:58:21 -04:00
|
|
|
mov r8b, [text]
|
|
|
|
add r8b, 1
|
|
|
|
mov [text], r8b
|
|
|
|
|
2021-09-07 21:27:56 -04:00
|
|
|
mov rdi, text
|
|
|
|
cld
|
|
|
|
call puts ;this is the put s way of printing a string
|
|
|
|
|
2021-09-07 19:58:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-07 21:27:56 -04:00
|
|
|
|
|
|
|
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
|
2021-09-07 19:58:21 -04:00
|
|
|
cld
|
2021-09-07 20:01:27 -04:00
|
|
|
call puts ;this is the put s way of printing a string
|
2021-09-07 19:58:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
_end:
|
2021-09-07 21:27:56 -04:00
|
|
|
add rsp, 8
|
|
|
|
ret
|
|
|
|
|
|
|
|
; mov rax, 60 ; exit
|
|
|
|
; mov edi, 1 ; error 1 dont need the exit anymore beacue libc or somthing
|
|
|
|
; syscall
|
2021-09-07 19:58:21 -04:00
|
|
|
|
|
|
|
|