Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. unsigned int seed_o = 0x45168297;
  3.  
  4.  
  5. void srand (unsigned seed)
  6. {
  7. seed_o = seed;
  8. }
  9.  
  10.  
  11. int rand (void)
  12. {
  13. seed_o = seed_o * 0x15a4e35 + 1;
  14. return(seed_o >> 16);
  15. }
  16.  
  17.  
  18. void* malloc(unsigned s)
  19. {
  20. asm ("int $0x40"::"a"(68), "b"(12), "c"(s) );
  21. }
  22.  
  23.  
  24. void free(void *p)
  25. {
  26. asm ("int $0x40"::"a"(68), "b"(13), "c"(p) );
  27. }
  28.  
  29.  
  30. void* realloc(void *p, unsigned s)
  31. {
  32. asm ("int $0x40"::"a"(68), "b"(12), "c"(p), "d"(s) );
  33. }
  34.