Register | Login
Forum Index > Source Help > GetTmpStr function
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[186] GetTmpStr function - posted: 2011-10-28 11:56:06
Hi

i will start converting some functions from BCX to Ziron.

this is the first one.

Here is it in c
Code:
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
Code:
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
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[187] - posted: 2011-10-28 13:17:56

when Ziron will support this
Code:
DWord[Ebx] = malloc(sizeInByte);


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[238] - posted: 2011-10-31 16:42:57
doesn't it already?

Code:
#include 'smm32.zir';

[ebx] = malloc(1024);


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[242] - posted: 2011-10-31 20:22:06

it 's okay now , thank you.

http://www.freewebs.com/ogremagic/index.htm
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 1 user(s) online. 0 member(s) and 1 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd