Register | Login
Forum Index > Plugins > Plugin: EMIT source
Author Message
Pages: 1 2 3 4
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[220] - posted: 2011-10-30 20:23:53

ok , could you please extend the system , so that it allowing changing the line , then reprocess it.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[222] - posted: 2011-10-30 20:38:30
changing the line will not be possible because it would mess with the internal buffer and would be dreadfully slow, but for following release i have an idea which you will like smile

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
[223] - posted: 2011-10-30 20:41:24


ok , Ziron will be the best programing language on earth.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[224] - posted: 2011-10-30 20:43:09
i hope so smile

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
[234] - posted: 2011-10-30 22:01:17
ok i just finished implementing this new feature i mentioned you will like...

First of course you will register your opcode, in my case i made a new named mycmd
Code:
Ziron_RegisterKeyword('mycmd', @event_myCMD);


next the callback

Code:
function event_myCMD() {
  eax = Ziron_Execute('mov eax, 5000', sizeof 'mov eax, 5000');
  if (eax == false) {
    Ziron_FatalError('myCMD plugin is not compatible with this version of Ziron');
  }  
  eax = true;
}


notice that you are able to execute ziron code from the Execute function, if the code fails it will return false, on success of course true smile

it will be as simple as that, no need to mess with the internal code or anything.

so the above code would allow someone to write an app like:

Code:
program WIN32CUI 'test';

#include 'console.zir';

eax = 1;
print('eax = ', eax:int, '\r\n');

myCMD;

print('eax = ', eax:int, '\r\n');

wait_key(nil);
ExitProcess(0);


and the output would be:

Code:
eax = 1
eax = 5000


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
[241] - posted: 2011-10-31 20:14:37

well done ... , thank you very much.

just want to understand some uncleared things.

1- when Ziron_Execute executes it's parameters , is it interpreter , i am Little confused.

2- the return value of Ziron_Execute how can we make use of it?

3- can i extract some date from our line just like emit_Pligin then process that data then
pass it again to Ziron_Execute.

please more explanation.

http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[246] - posted: 2011-10-31 20:49:33

also can i register an opcode that already been registered,

for example , can i register mov instruction so that i can extend it.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[248] - posted: 2011-11-01 18:00:03
indeed you can, that is the point of the return false, so for example, you want to extend an opcode mov to support into....

you would move your token forward checking for into, if it does not exist, then let the assembler check if it supports the written mov by returning false. I hope you understand, anyway i will write a sample to help better understand the methods. smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2 3 4
create new reply


Quick reply:

Message:



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