Skip to content

Instantly share code, notes, and snippets.

@itsecurityco
Last active January 9, 2018 17:45
Show Gist options
  • Save itsecurityco/975a0c2bab501d7548fef0e572c2c109 to your computer and use it in GitHub Desktop.
Save itsecurityco/975a0c2bab501d7548fef0e572c2c109 to your computer and use it in GitHub Desktop.
Hello world in asm
; Author: Juan Escobar
; /usr/include/i386-linux-gnu/asm/unistd_32.h
; nasm -f elf -o HelloWorld.o HelloWorld.asm
; ld -o HelloWorld HelloWorld.asm
global _start
section .text
_start:
; print "Hello World!" on the screen
mov eax, 0x4 ; system call _write(fd, *buf, lenght)
mov ebx, 0x1 ; file descriptor (standart output)
mov ecx, message ; *buf
mov edx, 0x0c ; lenght (12)
int 0x80 ; interruptor
; exit the program
mov eax, 0x1 ; system call _exit(status)
mov ebx, 0x5 ; status (5)
int 0x80 ; interruptor
section .data
; label
message: db "Hello World!" ; define byte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment