format ELF section '.text' executable public _start _start: push msg_len ; size of message push msg ; offset of message push 1 ; stdout mov eax,4 ; 4 = sys_write push eax int 0x80 add esp,4*3 ; clear stack after interupt ;exit from programm xor eax, eax ;eax = 0 push eax inc eax ;eax = 1, sys_exit int 80h ;system interupt section '.data' writeable msg db "Hello world",0 msg_len = $-msg
Compilations is easy as before
fasm hello.asm hello.o
ld -o hello hello.o