Created
August 17, 2015 07:21
-
-
Save codetalks-new/9aedfe717459b03e71b4 to your computer and use it in GitHub Desktop.
HelloAssembley OS X from https://lord.io/blog/2014/assembly-on-osx/ with a small bug fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%define SYSCALL_WRITE 0x2000004 | |
%define SYSCALL_EXIT 0x2000001 | |
global start | |
start: | |
mov rdi, 1 | |
;mov rsi, str | |
lea rsi, [rel str] | |
mov rdx, strlen | |
mov rax, SYSCALL_WRITE | |
syscall | |
mov rax, SYSCALL_EXIT | |
mov rdi, 0 | |
syscall | |
section .data | |
str: | |
db `Hello, assembly!\n` ; to use escape sequences, use backticks | |
strlen equ $ - str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment