Author | Message |
Emil_halim Ziron Beta Tester (send private message) Posts: 639 Topics: 104 Location: Alex, Egypt | [1164] - posted: 2012-05-18 23:37:38 good, by the way i was tring this but it always crash. Code:
http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [1165] - posted: 2012-05-19 00:14:21 eax can not be passed as a string to print, i have added a error for this in next release, you can use edx or other registers: Code:
but easiest and best way: Code:
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 | [1168] - posted: 2012-05-19 19:07:27 ok , i was playing with printf function from msvcrt.dll and used it instead of print but it crashed , i think it is a problem with cdecl. Code:
http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [1169] - posted: 2012-05-20 13:59:25 hi emil, there is no problem with cdecl, i see your mistake: all windows functions do not preserve ecx and edx, infact it is normal for all functions to trash eax-edx, so you have 2 options: Code:
or better: Code:
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 | [1170] - posted: 2012-05-20 15:53:54 oh , i see now. but what exactly is the free register that can be used and what that used by windows function. http://www.freewebs.com/ogremagic/index.htm |
Admin Site Admin (send private message) Posts: 933 Topics: 55 Location: OverHertz Studio | [1171] - posted: 2012-05-20 16:23:56 well the registers are: Code:
eax-edx are usually trashed in external function calls (internal depends if the function has been written to protect the register. ebp is used for stack frame in functions, esp is the stack pointer, else ebx, esi and edi are good to go in most cases, of course ecx and edx are still usable in alot of cases, you just need to check if the external functions will trash the register or not. 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 | [1172] - posted: 2012-05-20 18:54:56 ok , thanks for your help. I am stuck here , i was implement strArr like this Code:
but it crashed. so i think Ziron_GetStringValue() may change edi or ebx? then i tried this Code:
it did not crashed , do you have any suggestion or another approach? thanks. http://www.freewebs.com/ogremagic/index.htm |
Emil_halim Ziron Beta Tester (send private message) Posts: 639 Topics: 104 Location: Alex, Egypt | [1173] - posted: 2012-05-20 19:29:33 ok i found the error , here is the new code Code:
there is another thing when using this , it crashed Code:
and when using this , it's okay Code:
http://www.freewebs.com/ogremagic/index.htm |
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 |