Overflow,
how can I implement the putchar(char) procedure using inline assembly only? I would like to do this in x86-64 assembly. The reason for me doing this is to implement my own standard-lib (or at least part of it). Here is what I have so far:
void putchar(char c)
{
/* your code here: print character c on stdout */
asm(...);
}
void _start()
{
/* exit system call */
asm("mov $1,%rax;"
"xor %rbx,%rbx;"
"int $0x80"
);
}
I am compiling with:
gcc -nostdlib -o putchar putchar.c
Thanks for helping me!
See Question&Answers more detail:os