program | 002 - Hello World with kernel |
architecture | x86-32 |
assembler | gas |
.globl _start .section .rodata msg: .ascii "Hello World!\n" .set MSG_LEN, . - msg .section .text _start: ## write (STDOUT_FILENO, msg, MSG_LEN) movl $4, %eax # sys_write movl $1, %ebx # STDOUT_FILENO movl $msg, %ecx movl $MSG_LEN, %edx int $0x80 ## exit (0) movl $1, %eax # sys_exit movl $0, %ebx int $0x80
as --32 -o main.o main.s ld -m elf_i386 -o main main.o