Register | Login
Forum Index > Plugins > Plugin: EMIT source
Author Message
Pages: 1 2 3 4
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[249] - posted: 2011-11-01 18:05:31
btw your post above


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.


OK, so...

1. when you pass the string parameter to Ziron_Execute, it will convert your passed code (ziron syntax etc) into machine code and enter it into the current scope m/c buffer.

2. The return value of Ziron_Execute is a simple true or false, if the syntax you passed to Ziron_Execute is not supported (not valid Ziron syntax) or for any other reason it fails, it will return false, else if the code is entered into the m/c it will return true.

3. Yes, so lets say you parse the code:
Code:
mov 10 into eax


you can then call Code:
Ziron_Execute('eax = 10;')


Please let me know if you have further questions 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
[252] - posted: 2011-11-01 18:51:58

very nice , got it new.

just want to touch that feature , when will you release it ?


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[253] - posted: 2011-11-01 18:57:26
I'm working on implementing fastcall, and have plans for a few other features and improvements, once i am satisfied with them i will make a new release. I may make a pre-release tomorrow afternoon - a kind of beta release for testing before offical release, but i will see.

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
[254] - posted: 2011-11-01 19:07:13

great ,

so i can test a pre released version , and tell you if there were any bugs.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[262] - posted: 2011-11-02 16:36:46
I'm hoping i have not broken anything other when implementing fastcall, but else it seems fine

Code:
program WIN32CUI 'test';

#cpu 686;

#include 'console.zir';
#include 'ch.zir';


procedure myStdCallFunc(DWord a,b,c) {
  eax = a;
}

procedure cdecl myCDeclFunc(DWord a,b,c) {
  eax = a;
}

procedure fastcall myFastCallFunc(DWord a,b,c) {
  eax = a;
}


//////////////////////////////////////////////////

push esi
push edi

esi = getTickCount();

for (edi = 1 to 900000000) {
  myStdCallFunc(1,2,3);
}

eax = getTickCount();
sub eax, esi

print('Time taken: ', eax:int, 'ms\r\n');

//////////////////////////////////////////////////

esi = getTickCount();

for (edi = 1 to 900000000) {
  myCDeclFunc(1,2,3);
}

eax = getTickCount();
sub eax, esi

print('Time taken: ', eax:int, 'ms\r\n');


//////////////////////////////////////////////////

esi = getTickCount();

for (edi = 1 to 900000000) {
  myFastCallFunc(1,2,3);
}

eax = getTickCount();
sub eax, esi

print('Time taken: ', eax:int, 'ms\r\n');

pop edi
pop esi


//////////////////////////////////////////////////

wait_key(nil);
ExitProcess(0);


after running this code a few time the averages...

stdcall, cdecl: 3438
fastcall: 2657

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
[263] - posted: 2011-11-02 16:45:03
some more for fun

Code:
program WIN32CUI 'test';

#cpu 686;

#include 'console.zir';
#include 'ch.zir';


procedure myStdCallFunc(DWord a,b,c,d,e,f) {
  uses edi esi ebx;
  
  eax = a;
  edx = b;
  ecx = c;
  ebx = d;
  esi = e;
  edi = f;
}

procedure cdecl myCDeclFunc(DWord a,b,c,d,e,f) {
  uses edi esi ebx;
  
  eax = a;
  edx = b;
  ecx = c;
  ebx = d;
  esi = e;
  edi = f;
}

procedure fastcall myFastCallFunc(DWord a,b,c,d,e,f) {
  uses edi esi ebx;
  
  eax = a;
  edx = b;
  ecx = c;
  ebx = d;
  esi = e;
  edi = f;
}


//////////////////////////////////////////////////

esi = getTickCount();

for (edi = 1 to 900000000) {
  myStdCallFunc(1,2,3,4,5,6);
}

eax = getTickCount();
sub eax, esi

print('Time taken: ', eax:int, 'ms\r\n');

//////////////////////////////////////////////////

esi = getTickCount();

for (edi = 1 to 900000000) {
  myCDeclFunc(1,2,3,4,5,6);
}

eax = getTickCount();
sub eax, esi

print('Time taken: ', eax:int, 'ms\r\n');


//////////////////////////////////////////////////

esi = getTickCount();

for (edi = 1 to 900000000) {
  myFastCallFunc(1,2,3,4,5,6);
}

eax = getTickCount();
sub eax, esi

print('Time taken: ', eax:int, 'ms\r\n');

//////////////////////////////////////////////////

wait_key(nil);
ExitProcess(0);


stdcall: 7409 ms
cdecl: 7000 ms
fastcall: 4071 ms

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
[264] - posted: 2011-11-02 17:26:48
and finally a peek of using the new ziron call method zircall



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
[265] - posted: 2011-11-02 17:47:49
well done smile

is FastCall passes the first and second parameters in Eax , Edx or what?

also what ZironCall passes the parameters?

finally , need to use register directly as a parameter instead pushing in the stack , this will increase the speed of course.


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


Quick reply:

Message:



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