Last active
August 29, 2015 14:20
-
-
Save soardex/c3a5a71fd1db26c0596f to your computer and use it in GitHub Desktop.
Hello World Assembly Language
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
; compiling on x86-64 | |
; nasm -f elf64 hello.asm -o hello.o | |
; ld -s -o hello hello.o | |
section .text | |
global _start | |
_start: | |
mov eax,4 ; system call ID: sys_write | |
mov ebx,1 ; file descriptor for standard output | |
mov ecx,string ; string address | |
mov edx,length ; string length | |
int 0x80 ; system call | |
mov eax,1 ; system call ID: sys_exit | |
mov ebx,0 ; exit code 0: no error | |
int 0x80 ; system call | |
section .data | |
string: db 'Hello, world', 0x0A ; output string | |
length: equ 13 ; lenght of string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment