2021-09-07 06:55:26 -04:00
|
|
|
section .data
|
2021-09-07 07:47:24 -04:00
|
|
|
text db 65,10
|
|
|
|
fuckvalue db 255
|
2021-09-07 19:58:21 -04:00
|
|
|
texthello db "hello world",10
|
2021-09-07 06:55:26 -04:00
|
|
|
section .text
|
|
|
|
global _start
|
|
|
|
|
|
|
|
_start:
|
2021-09-07 19:58:21 -04:00
|
|
|
mov r8b, [fuckvalue] ; put the shit in the register for later
|
|
|
|
mov r9b, [text]
|
2021-09-07 07:47:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
mov rax, 1 ;syscall 1
|
|
|
|
mov rdi, 1 ; arg 1 (stdout)
|
|
|
|
mov rsi, text ; the shit to print
|
|
|
|
mov rdx, 2 ; the length
|
|
|
|
syscall ;invoke
|
|
|
|
|
|
|
|
|
2021-09-07 19:58:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmp r8b, r9b
|
2021-09-07 07:47:24 -04:00
|
|
|
je _end
|
|
|
|
|
|
|
|
;inc text
|
2021-09-07 19:58:21 -04:00
|
|
|
mov r9b, [text]
|
|
|
|
inc r9b
|
|
|
|
mov [text], r9b
|
2021-09-07 07:47:24 -04:00
|
|
|
|
|
|
|
jmp _start
|
|
|
|
|
2021-09-07 06:55:26 -04:00
|
|
|
|
2021-09-07 07:47:24 -04:00
|
|
|
_end:
|
2021-09-07 19:58:21 -04:00
|
|
|
|
|
|
|
mov rax, 1 ;syscall 1
|
|
|
|
mov rdi, 1 ; arg 1 (stdout)
|
|
|
|
mov rsi, texthello ; the shit to print
|
|
|
|
mov rdx, 12 ; the length
|
|
|
|
syscall ;invoke
|
|
|
|
|
|
|
|
mov rax, 60 ; exit
|
|
|
|
mov edi, 1 ; error 1
|
2021-09-07 07:47:24 -04:00
|
|
|
syscall
|
2021-09-07 19:58:21 -04:00
|
|
|
|
|
|
|
|