This is the 32bit version of the famous: "hello, world" program written in assembly language for a Linux system.
.section .text
.global _start
_start:
movl $4, %eax
movl $1, %ebx
movl $msg, %ecx
movl $len, %edx
int $0x80
# exit
movl $0, %ebx
movl $1, %eax
int $0x80
.section .data
msg: .ascii "Hello, world\n"
len = . - msg
Compile and link with the following commands:
as -o hello.o hello.S
ld -o hello hello.o
And as usual run it with:
./hello