/* hello-i386.S : example of using int 0x80 to do Linux syscalls */ /* * gcc -m32 -nostdlib -static hello-i386.S */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #define SYS_EXIT 1 #define SYS_WRITE 4 .text .globl _start _start: movl $SYS_WRITE, %eax movl $STDOUT_FILENO, %ebx movl $hello_world, %ecx movl $hello_world_len, %edx int $0x80 movl $SYS_EXIT, %eax xorl %ebx, %ebx int $0x80 .data hello_world: .ascii "Hello World\n" hello_world_len = . - hello_world