Register | Login
Forum Index > Requests and Feedback > ZirToken
Author Message
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[498] - posted: 2011-11-09 14:49:58

adding string assignment to Ziron is good idea ,

what do you mean by term
unnamed functions
, is it away to allow us handling
assignment and expressions from plugin ?



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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[500] - posted: 2011-11-09 15:01:38
no it is a way to have functions in plugins that do not affect source functions, i will explain in detail once done

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
[502] - posted: 2011-11-09 15:04:39

ok , but is there a way to handle expression from plugIn?

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[504] - posted: 2011-11-09 15:49:58
you could pre-process the files

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[506] - posted: 2011-11-09 16:46:21
I think ziron will need to have a special string type and handled with special care, lets take this into account

Code:
char* myStr;
myStr = strUpper('Testing this string'); //myStr points a constant 19 bytes
print('myStr = ', myStr, '\r\n');


string assignment is already possible as you see, but this uses constant strings and so on... so i think ziron needs a special 'string' type that needs to be initialized and handled differently to other data types.

maybe if when a string is created it is 4+length. e.g.

string = [dword][data];

the first 4 bytes would contain how much memory has been allocated for this string, ziron could then keep track of this when referencing a string and do an automatic check to see if more space needs allocated, else a string would be referenced with a 4 byte offset.

e.g.

Code:
string myStr;
myStr = 'testing';


the following string would be initialized with a default string length, lets say 4+32=36 characters. then [myStr+4] is copied 'testing' and the first 4 bytes will be set to 32


now lets say we do

Code:
myStr = 'This is a longer string that will not fit into the 32 character buffer so will need to be extended';


first ziron will product code to check the length of the new string or using sizeof if it is a constant, which then will product code to check the allocated size of memory for the string.

pseudo e.g.

Code:
eax = [mystring_address];
if (total_new > eax) {
   eax = total_new + allign to 32 byte boundary

   reallocate old string to new buffer and free old buffer

   set first 4 bytes to new size
}


anyways i think i will need to carefully think about this

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
[509] - posted: 2011-11-09 17:22:10

Ok , pascal and HLa-asm uses an other way of zero terminated string. something like this
Code:
block string
{
   DWord strLen;
   char* strAddr;
}


so if you have a variable that holds a string pointer , you can get it's Len by seeing the
address before the pointer.

BCX , has an other way , already convert it to ziron, by function H_GetTmpStr.
every time you call H_GetTmpStr it will allocate a new string with desired length , it has
pointer table that stores pointers in it and if it exceed it's boundary it will free the first one in the table and allocate a new one. here is the the H_GetTmpStr code.
Code:
function H_GetTmpStr(DWord sizeInByte)
{
   uses Ebx Ecx;   
   global int32   StrCnt;
   global char*   StrFunc[2048];
   Eax = StrCnt;
   Eax++;
   and Eax,2047
   StrCnt = Eax;
   Ebx = @StrFunc;
   lea Ebx,[Ebx+Eax]
   Eax=DWord[Ebx];
   if( Eax> 0)
    {
       freemem( Eax);
    }
   [Ebx]= malloc(sizeInByte);
}


actually i prefer it.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[512] - posted: 2011-11-09 18:35:37
i will add some new event functions such as....

onVariable
onLocal
onRegister

each of them will be fired when lets say:

Code:
eax = 1;


onRegister would be fired before anything is processed here, but not inside of calls or other code so...

Code:
mov eax, 5


this code would not be affected by the event, only when a register is the start of a new command, for higher level code, this would allow for you to write assignment plugins and so on....

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
[513] - posted: 2011-11-09 18:44:41

good idea ,

BTW does Ziron keep track of global variables, local variables , local addresses, global
addresses in a tables.

and if so can we access to them from plugin ?


http://www.freewebs.com/ogremagic/index.htm
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 14 user(s) online. 0 member(s) and 14 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