Skip to content

Instantly share code, notes, and snippets.

@gustavonovaes
Created April 24, 2020 14:00
Show Gist options
  • Save gustavonovaes/dd642c63356ef6760b8b4551e3523bdd to your computer and use it in GitHub Desktop.
Save gustavonovaes/dd642c63356ef6760b8b4551e3523bdd to your computer and use it in GitHub Desktop.
; hello_world.asm
;
; Author: Gustavo Novaes
; Date: 2019-10-14
; nasm -f elf32 -o hello.o hello_world.asm
; ld -m elf_i386 -o hello hello.o
global _start
section .text:
_start:
mov eax, 0x4 ; use the write syscall
mov ebx, 1 ; use stdout as fd
mov ecx, message ; use the message as the buffer
mov edx, message_length ; and supply the length
int 0x80 ; invoke the syscall
; now gracefully exit
mov eax, 0x1
mov ebx, 0
int 0x80
section .data:
message: db "Hello World!", 0xA
message_length equ $-message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment