A poorly written OS for the x86 arch. (WIP)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include "strf.h"
|
|
|
|
#define int_offset 48
|
|
// 0:48 - 9:57
|
|
|
|
char* int_to_str(int i, char* strbuf) {
|
|
if( i == 0 ) {
|
|
return (char*)(int_offset);
|
|
} else {
|
|
char cbuf;
|
|
cbuf = (char)((i % 10) + int_offset);
|
|
|
|
return int_to_str(i / 10, strbuf + cbuf);
|
|
}
|
|
}
|
|
|