GNU Assembler

Hello World
.section .data         # data starts here string: .ascii "Hello World!\n" s_size: .long. - string       # string_size: 14 .section .text         # code starts here .globl _start _start: movl $4, %eax          # syscall 4: write(fd, buf, size) movl $1, %ebx          # file descriptor (stdout) movl $string, %ecx     # buffer start movl s_size, %edx      # buffer size int $0x80              # syscall interrupt movl $1, %eax          # syscall 1: exit(rc) movl $0, %ebx          # rc         int $0x80               # syscall interrupt Assemble and link: as -otest.o test.s ld test.o ./a.out
 * 1) write(1, "huba\n", 5)
 * 1) exit(0) - you must call this to avoid segfault