Register | Login
Forum Index > Requests and Feedback > get entire line
Author Message
Pages: 1 2 3 4 5 6 7 8
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[446] - posted: 2011-11-07 21:30:57

what do you think about that
Code:
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
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[447] - posted: 2011-11-07 21:34:20

after i got the line , i can search for ';' and extract whatever befor it and execute it.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[448] - posted: 2011-11-07 21:38:45
why do you want to manually send process commands for the mov instructions rather then just let the assembler handle them...

another problem without ;

Code:
mov eax, 10 mov edx, 5 mov
                           ecx,
                           12
mov  edi,
     31
esi = xor;


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
[449] - posted: 2011-11-07 21:43:45

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
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[450] - posted: 2011-11-07 21:55:12
just to let you know, i've updated Ziron so that [expressions] will show as their string representation.

e.g.
Code:
[ecx+edx+5]


will be shown now from GetStringValue

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
[451] - posted: 2011-11-07 22:02:44
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.

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
[452] - posted: 2011-11-07 22:10:46

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
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[453] - posted: 2011-11-07 22:11:35
lets take this example of extension, not tested

Code:
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

Code:
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.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2 3 4 5 6 7 8
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