diff --git a/hello.s b/hello.s new file mode 100644 index 0000000..35dd483 --- /dev/null +++ b/hello.s @@ -0,0 +1,27 @@ +global _start + +; constants +SYS_WRITE equ 1 +SYS_EXIT equ 60 +STDOUT equ 1 + +SECTION .data +hello db "Hello world!", 0x0a +hello_len equ $ - hello + +SECTION .text + +_start: + ; syscall(SYS_WRITE, STDOUT, hello, hello_len); + mov rax, SYS_WRITE + mov rdi, STDOUT + mov rsi, hello + mov rdx, hello_len + syscall + push rax + + ; syscall(SYS_EXIT, - hello_len); + mov rax, SYS_EXIT + pop rdi + sub rdi, hello_len + syscall diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d88bd5c --- /dev/null +++ b/readme.md @@ -0,0 +1,8 @@ +# x86_64 assembly + +https://userpages.cs.umbc.edu/tsimo1/CMSC313/nasmdoc/html/nasmdoc3.html +https://x64.syscall.sh/ + +https://web.stanford.edu/class/cs107/resources/x86-64-reference.pdf +https://ggbaker.ca/295/x86.html +https://josemariasola.github.io/reference/assembler/Stanford%20CS107%20Guide%20to%20x86-64.pdf