Skip to content

Instantly share code, notes, and snippets.

@ttesmer
Last active June 11, 2022 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttesmer/8a3617274723f2904ec0eef3c9614cf0 to your computer and use it in GitHub Desktop.
Save ttesmer/8a3617274723f2904ec0eef3c9614cf0 to your computer and use it in GitHub Desktop.
"Hello world" in 32-bit assembly. Link with gcc using `gcc -nostdlib -m32 hello_world.s`
.section .text
.global _start
_start:
mov $4, %eax
mov $1, %ebx
mov $message, %ecx
mov msglength, %edx
int $0x80
mov $1, %eax
mov $0, %ebx
int $0x80
.section .data
message: .ascii "Hello, world!\n"
msglength: .word 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment