├── .gitignore └── main.c /.gitignore: -------------------------------------------------------------------------------- 1 | simpleio 2 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | // Hello world without using stdio. 2 | 3 | void print(char* msg, long length) { 4 | asm("movq $4, %%rax\n\t" 5 | "movq $1, %%rbx\n\t" 6 | "movq %0, %%rcx\n\t" 7 | "movq %1, %%rdx\n\t" 8 | "int $0x80" 9 | : 10 | : "r" (msg), "r" (length) 11 | : "%rax", "%rbx", "%rcx", "%rdx"); 12 | } 13 | 14 | int main() { 15 | print("Hello world!\n", 13); 16 | } 17 | --------------------------------------------------------------------------------