Skip to content

Instantly share code, notes, and snippets.

@pacifiquem
Created November 26, 2023 07:53
Show Gist options
  • Save pacifiquem/095e7a755d16bce969ce41a620e388e2 to your computer and use it in GitHub Desktop.
Save pacifiquem/095e7a755d16bce969ce41a620e388e2 to your computer and use it in GitHub Desktop.
Hello World in assembly!
section .data
hello db 'Hello, World!',0
section .text
global _start
_start:
; write the string to stdout
mov eax, 4 ; system call number for sys_write
mov ebx, 1 ; file descriptor 1 is stdout
mov ecx, hello ; pointer to the string
mov edx, 13 ; length of the string
int 0x80 ; call kernel
; exit the program
mov eax, 1 ; system call number for sys_exit
xor ebx, ebx ; exit code 0
int 0x80 ; call kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment