22 char *itoa(
unsigned int num)
35 for(i=0;i<11 && num!=0;i++)
37 buf[i]=(char)((num%10)+
'0');
51 char *itoh(
unsigned int num)
76 buf[i]=(char)((num%16)+
'0');
78 buf[i]=(char)((num%16)+
'W');
88 if(num<0)
return -num;
92 int rand(
int seed,
int min,
int max)
96 lfsr = (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u);
98 return (lfsr % max + min);
101 int add(
int a,
int b)
110 int sub(
int a,
int b)
118 void *memset(
void *dst,
int c,
unsigned long bytes) {
120 unsigned char *Dst = (
unsigned char*)dst;
122 while((
int)bytes-- > 0)
123 *Dst++ = (
unsigned char)c;
128 char *fixetoa(
int nume)
131 static char buf2[13];
139 for(i=0;i<12 && (num!=0 || i<5) ;i++)
145 buf[i]=(char)((num%10)+
'0');
179 for(i=0;i<12 && (num!=0 || i<5);i++)
185 buf[i]=(char)((num%10)+
'0');
208 char *strcpy(
char *dst,
const char *src) {
228 int strlen(
const char *
string) {
230 const char *base=string;
234 return string - base - 1;