URL
https://opencores.org/ocsvn/mips789/mips789/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 15 |
Rev 35 |
Line 29... |
Line 29... |
unsigned int i,ret=0 ;
|
unsigned int i,ret=0 ;
|
if(par==NULL)return ;
|
if(par==NULL)return ;
|
if((0==strncmp(par,"0x",2))||(0==strncmp(par,"0X",2)))
|
if((0==strncmp(par,"0x",2))||(0==strncmp(par,"0X",2)))
|
for(i=2;;++i)
|
for(i=2;;++i)
|
{
|
{
|
if(par[i]=='\0')return ret ;
|
if(par[i]=='\0')return ret ;if(par[i]==' ')return ret ;
|
ret=ret*16+hex2byte(par[i]);
|
ret=ret*16+hex2byte(par[i]);
|
}
|
}
|
else
|
else
|
for(i=0;;++i)
|
for(i=0;;++i)
|
{
|
{
|
if(par[i]=='\0')return ret ;
|
if(par[i]=='\0')return ret ;if(par[i]==' ')return ret ;
|
ret=ret*10+hex2byte(par[i]);
|
ret=ret*10+hex2byte(par[i]);
|
}
|
}
|
return 0 ;
|
return 0 ;
|
}
|
}
|
/****************************/
|
/****************************/
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.