Last active
June 11, 2022 06:47
-
-
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`
This file contains 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
.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