x86_64-linux-asm/helloworld/hello.asm
2021-09-07 19:58:21 -04:00

47 lines
638 B
NASM

section .data
text db 65,10
fuckvalue db 255
texthello db "hello world",10
section .text
global _start
_start:
mov r8b, [fuckvalue] ; put the shit in the register for later
mov r9b, [text]
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
cmp r8b, r9b
je _end
;inc text
mov r9b, [text]
inc r9b
mov [text], r9b
jmp _start
_end:
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
syscall