www.main.lv
Don't think just code it

2009-04-07 FreeBSD assembler asm from C

This is example how to combine assemblers code with C code
Filename: main.c
extern out_f();
int main()
{
	out_f();
	return 0;
}

Here is assemblers code
Filename: out.asm
format ELF
section '.text' executable
public out_f
out_f:
	push msg_len
	push msg
	push 1
	mov eax, 4
	push eax
	int 0x80
	add esp, 4*4
	ret
section '.data' writeable
msg db "Hello from out.asm",0
msg_len = $-msg

Compiling lines is:
gcc -c main.c -o main.o
fasm out.asm out.o
gcc main.o out.o -o main