; This simple program prints out a
; Hello World message to the console.

; How To Run
; Assemble with: pasm hello-world.pasm
; Link with: pld hello-world.o
; Execute with: :./hello-world.out

; Print consts
WRITE equ 1
STDOUT equ 1

; Exit consts
EXIT equ 0x3c
SUCCESS equ 1

; This is the entry symbol for linker 
; to know where to set the starting point
global _start:

; Print Hello World
mov rsi, hello_world 	; The Hello World string
mov rdx, @hello_world	; The size of the Hello World string
mov rax, WRITE 			; WRITE syscall
mov rdi, STDOUT 		; Standard output
syscall

; Exits the program
mov rax, 0x3c			; EXIT syscall
mov rdi, SUCCESS		; Error code - Success
syscall

; The Hello World string
hello_world db "Hello, World!", 10
