Register | Login
Forum Index > Requests and Feedback > plugin for Ziron
Author Message
Pages: 1 2
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[98] plugin for Ziron - posted: 2011-10-24 00:15:25

when it will be possible to extend the features of Ziron by using plugin system?

I was thinking to add a macro system that smiler to Fasm or Masm and also include some Fasm &
Masm code directly inside Ziron code , there are a big variety code already made and we can
make use of them without converting them.

Emil.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[100] - posted: 2011-10-24 00:47:50
Maybe in second coming release, if you tell me what sort of functions you will require, i will put them on a priority list. 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
[101] - posted: 2011-10-24 02:36:17
just spend some time finishing the plugin system, i will begin exposing some functionality tomorrow most likely.. a sample ziron assembler plugin written in ziron

Code:
program WIN32DLL 'Sample';

#include 'ziron32.zir';

const strLoaded = 'Test plugin has been loaded'; 

//////////////////////////////
function* GetFunction(char* strName): DWord; stdcall;

function InitPlugin(pointer pGetF) {
  GetFunction = pGetF;
  
  //do something  
  //GetFunction(.... coming soon
  
  return strLoaded;
}

entry function DLLMain(DWord iDLL; DWord iReason; Pointer iResult) {
  if (iReason == DLL_PROCESS_ATTACH) {
    return true;
  }

  return false;
}

exports InitPlugin;


of course this does nothing much apart from output the message the plugin has been loaded, but it gives an example of the simplicity of the plugin system.



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
[104] - posted: 2011-10-24 08:08:13

so nice and simple system.

I suggest that , you can path the entire source code line to the plugin ,then the plugin
will pares it and changes it then paths back to Ziron to also pares it again.

Emil.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[106] - posted: 2011-10-24 10:55:47
I do not quite understand your request, can you please clarify smile

-Thanks

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
[109] - posted: 2011-10-24 19:34:15

sorry ,

I want to allow the plugin system to share Ziron when parsing the source code , so we can extend the Ziron features without touching Ziron itself.

for example , if i have this line in source code

xor eax;

so Ziron will not understand it , but we can pass this line to a plugin then it will changes it to be like this

xor eax,eax;

then passing this changed line back to Ziron again to parsing it as usual.

so i can made a plugin that understand basic syntax and convert it to Ziron normal syntax.

hope you got me now.

Emil.


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[119] - posted: 2011-10-25 20:14:57
Ziron's parser does not work on a line by line basis, so passing line by line to a plugin is not possible, however I have added a function to allow access to each file's code as it is included before compilation of the file begins.

Basically a pointer is passed to the code in memory, allowing for changes in code, however this is a problem since the size of memory needs also to be expanded, so i'm thinking about adding a grow function, allowing plugins to call Ziron_GrowMem(32)

which of course will realloc the memory with the additional size of 32 kb of ram.. it may be difficult for plugin writers to know exactly how much more ram their plugin would require, meaning they would need to often call the grow function as it becomes necessary.

Reallocating is not fast of course, however... plugins can resize by lets say 32kb, and keep track of the size, and if it plans to go over 32kb, to call to realloc again, 32kb i believe is more than enough space for any changes anyways. infact, in most cases, they may not even need to reallocate more than for 10000 character changes, 10kb would usually be more than enough.

Optionally, it could be made that the plugin writer allocates the space they need, write the entire file into a buffer, pass it to the plugin and the compiler can replace the internal buffer by copying the contents of the new buffer.

anyhow it is up for sugestions 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
[122] - posted: 2011-10-25 20:35:20

i have two ideas.

first: we can pass the filename of source code that will compiled by Ziron to the pluging
then the plugin will load the file and changes it then save it again the Ziron will take the
control.

second: and i prefer it , Ziron will load the file then pass each line to a plugin and after
the plugin changes the code , Ziron save that to file and load it again to compile it as usual.

note will , there will be more than one plugins form the users and each one will change the code as wanted. so the plugins must be ordered and the second solution will do it.

Emil.


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


Quick reply:

Message:



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