There is a tiny program without main() and printf().
//tinyhello.c
char *str = "Hello world!/n";
void print() {
asm( "movl $13, %%edx /n/t"
"movl $13, %%edx /n/t"
"movl $13, %%edx /n/t"
"movl $13, %%edx /n/t"
:: "r" (str):"edx", "ecx", "ebx");
}
void exit() {
asm( "movl $42, %ebx /n/t"
"movl $1, %eax /n/t"
"int $0x80 /n/t");
}
void nomain() {
print();
exit();
}
$ gcc -c fno-builtin tinyhello.c // compile it with gcc.
$ ld -static -e nomain -o tinyhello tinyhello.o // link it with ld.
$ ./tinyhello // run it
$ echo $?
$ 42