Author | Message |
Admin Site Admin (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 Download Ziron Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message. |
Emil_halim Ziron Beta Tester (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:
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 (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 (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 (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 (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 (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:
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. |
Currently Active Users: There are currently 4 user(s) online. 0 member(s) and 4 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 |