GetTmpStr function
Hi
i will start converting some functions from BCX to Ziron.
this is the first one.
Here is it in c
char *BCX_TmpStr (size_t Bites)
{
static int StrCnt;
static char *StrFunc[2048];
StrCnt=(StrCnt + 1) & 2047;
if(StrFunc[StrCnt]) free (StrFunc[StrCnt]);
return StrFunc[StrCnt]=(char*)calloc(Bites+128,sizeof(char));
}
here is Ziron one , any suggestion
function GetTmpStr(DWord sizeInByte)
{
global int32 StrCnt;
global char* StrFunc[2048];
//StrCnt=(StrCnt + 1) & 2047;
Eax = StrCnt;
Eax++;
and Eax,2047
StrCnt = Eax;
//if(StrFunc[StrCnt]) free (StrFunc[StrCnt]);
Ebx = @StrFunc;
lea Ebx,[Ebx+Eax]
Ecx=DWord[Ebx];
if( Ecx> 0)
{
freemem( Ecx);
}
//return StrFunc[StrCnt]=(char*)calloc(Bites+128,sizeof(char));
Eax = malloc(sizeInByte);
DWord[Ebx]=Eax;
}
http://www.freewebs.com/ogremagic/index.htm