User:
Title: original content
Content:
section .data ; Where data is defined
text db "hello, world!", 10
section .text ; Where code goes
global _start
_start: ; A label for a section of code, essential to use _start!
call _printHello
call _exit
call _printHello
_printHello:
mov rax, 1 ; This is function 1 (sys_write)
mov rdi, 1 ; This is for the display
mov rsi, text ; This is the memory address of what to put on the screen
mov rdx, 14 ; This is the length of the string (???)
syscall
ret
_exit:
mov rax, 60 ; This is function 60 (exit)
mov rdi, 0 ; Exit with code 0
syscall
ret
Edit |
Back