Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #446
2011-11-07 21:30:57 UTC
what do you think about that
inline procedure Ziron_GotoNextLine()
{
ecx = ' ';
eax = Ziron_IsNextLineBreak();
while(!eax or ecx != zirSEMI_COLON)
{
ecx = Ziron_GetNextToken();
eax = Ziron_IsNextLineBreak();
}
}
http://www.freewebs.com/ogremagic/index.htm
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #447
2011-11-07 21:34:20 UTC
after i got the line , i can search for ';' and extract whatever befor it and execute it.
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #448
2011-11-07 21:38:45 UTC
why do you want to manually send process commands for the mov instructions rather then just let the assembler handle them...
another problem without ;
mov eax, 10 mov edx, 5 mov
ecx,
12
mov edi,
31
esi = xor;
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #449
2011-11-07 21:43:45 UTC
no , i will extend the mov instruction , but first i was trying to get the exact line and Execute it for testing purpose.
it seems you are wright , so i will get the line and check if the line holds any desired
token i will process it or i will Execute it as it was without changes
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #450
2011-11-07 21:55:12 UTC
just to let you know, i've updated Ziron so that [expressions] will show as their string representation.
e.g.
[ecx+edx+5]
will be shown now from GetStringValue
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #451
2011-11-07 22:02:44 UTC
it is the same as adding a new command as extending an opcode.
register "mov"
check next token = if valid
get next token = if valid -> next token etc, until you have all desired tokens, then execute the syntax, if along the lines the token is not what your plugin expected, you do not create a fatal_error, you just return false and ziron will handle it as if nothing was changed.
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #452
2011-11-07 22:10:46 UTC
ok , an other way and i think it is more easier
i will get the entire line the use instr function (i will create it) so if i found a desired
token i will start pares it as usual or just return false
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #453
2011-11-07 22:11:35 UTC
lets take this example of extension, not tested
function event_mov() {
char val[16];
char buf[128];
val = 0;
buf = 0;
eax = Ziron_ExpectNextToken(zirNumber);
if (eax = -1) {
return false;
}
strAppend(@val, Ziron_GetStringValue(), 16);
eax = Ziron_ExpectNextToken(448); //not added yet, i will for next release, 448 = "into"
if (eax == -1) {
return false;
}
eax = Ziron_ExpectNextToken(zirVar);
if (eax == -1) {
return false;
}
strAppend(@buf, Ziron_GetStringValue(), 128);
strAppend(@buf, '=', 128);
strAppend(@buf, @val, 128);
strAppend(@buf, ';', 128);
Ziron_Execute(...
return true; //complete, start processing after this.
}
allowing something like
int32 i;
mov 1000 into i
without breaking the current mov instruction, note that for next update i will try get the rest of the token list complete.