gblib src added

git-svn-id: svn://kolibrios.org@1879 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Albom
2011-02-18 17:46:37 +00:00
parent 0e98f2ea01
commit 2118401afb
15 changed files with 1179 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
unsigned int seed_o = 0x45168297;
void srand (unsigned seed)
{
seed_o = seed;
}
int rand (void)
{
seed_o = seed_o * 0x15a4e35 + 1;
return(seed_o >> 16);
}
void* malloc(unsigned s)
{
asm ("int $0x40"::"a"(68), "b"(12), "c"(s) );
}
void free(void *p)
{
asm ("int $0x40"::"a"(68), "b"(13), "c"(p) );
}
void* realloc(void *p, unsigned s)
{
asm ("int $0x40"::"a"(68), "b"(12), "c"(p), "d"(s) );
}