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
[267] - posted: 2011-11-02 18:06:24
fastcall uses in this order as borlands fastcall method: eax, edx, ecx and the registers are trashed.

however, zircall is my special development for ziron...

first it preserves ecx, edx, ebx, esi, edi

then uses the registers in this order for first 6 params: ebx, esi, edi, eax, ecx, edx

once returned, registers are restored, and as you see it works good, since it is faster than fastcall 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
[269] - posted: 2011-11-02 18:13:11

ok this is good , but...

to make thing is more clear , we can use that directly in our code eg.
Code:
function blabla(ebx, esi, edi, eax, ecx, edx)
{
  now when i see this function i will know the first para is in Ebx and so on
  
}


so you have the two options , and the user will choose the best for him.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[272] - posted: 2011-11-02 18:27:09
as i said other time i will probably add this, however it is more complex, i will get round to that on my list at some point.

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
[273] - posted: 2011-11-02 18:45:51

oh sorry , forgot that i have mentioned that early.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[278] - posted: 2011-11-02 19:19:26
i've slightly changed the zircall method, it will now use in order, eax, ecx, edx, ebx, esi then edi for 6 params, it will auto preserve ecx-edi when used. so basically i've changed it to be more similar to fastcall, but using 6 registers and auto preservation for simplicity... a bit less to write when coding.

the main advantage is when there is 4 or more params and you are using all of the params inside a function, since fastcall will use the stack above 3 params, and zircall will use stack above 6.

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
[279] - posted: 2011-11-03 06:57:47

i think that , auto preserve of ecx-edi or preserve all registers then call a functions
then restore them ,behind the sense , is not good.

we can use 'uses' keyword before the function call to preserve the only registers those we need to keep it's value. now we know what is going on.

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[280] - posted: 2011-11-03 13:08:05
actually i think it is very useful - you cant use uses to protect registers that have been moved before the function is called... imagine you pass 6 parameters, all those 6 registers would be trashed before the function is called, so you would need to usually write

Code:
push ecx
push edx
myFastCallFunc(...,...,...);
pop edx
pop ecx


without the push then pop, the originals before the mov to pass to fastcall func would be trashed, now same with zircall, however zircall will automatically preserve them and restore them when the function returns, i have done some testing and the performance difference with fastcall and zircall is the same (ish) with 3 params, the assembler optimises the pushes ahead of the moves to prevent dependancies... but as you see when there is 4 or more params, zircall is far faster.... so not only does it have advantages, but it can also be faster and no need to write lots of push's

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 9 user(s) online. 0 member(s) and 9 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