Calling exported string functions - PB 4.2 beta 2

Just starting out? Need help? Post your questions and find answers here.
Fred
Administrator
Administrator
Posts: 16618
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

srod wrote:Can I ask why PB passes an extra parameter when calling compiled user lib functions?
PB could need to reuse this parameter value, after the function call. Before VC8, the parameter value was never changed by the called function (as it was pushed on the stack which is not in the function scope), so we could use a trick to get it back if needed. With VC8, this trick didn't work anymore (the function can modify the user-parameter stack), so we have to duplicate the push, to be able to get it back if needed.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Is there an inconsistency somewhere that prevents us from calling an exported function that returns a string from within the same library? I'm assuming that the ASM output is different between a Procedure and ProcedureDLL.

Would it be possible to keep the ASM the same so that we can call these functions again with TailBite?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Removed by Mistrel. (I fixed the problem)
Last edited by Mistrel on Fri May 30, 2008 8:04 am, edited 2 times in total.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fred wrote:
srod wrote:Can I ask why PB passes an extra parameter when calling compiled user lib functions?
PB could need to reuse this parameter value, after the function call. Before VC8, the parameter value was never changed by the called function (as it was pushed on the stack which is not in the function scope), so we could use a trick to get it back if needed. With VC8, this trick didn't work anymore (the function can modify the user-parameter stack), so we have to duplicate the push, to be able to get it back if needed.
I see. Must admit that I have no experience with VC and so can't imagine why functions would modify the parameter stack? Still, mine is not to wonder why! :) Thanks.
I may look like a mule, but I'm not a complete ass.
Fred
Administrator
Administrator
Posts: 16618
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Mistrel wrote:Is there an inconsistency somewhere that prevents us from calling an exported function that returns a string from within the same library? I'm assuming that the ASM output is different between a Procedure and ProcedureDLL.

Would it be possible to keep the ASM the same so that we can call these functions again with TailBite?
Actually, there could be a solution on the compiler side. TailBaite creates pblibraries with the 'ASM' flags (in the .desc), right ?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fred wrote:
Mistrel wrote:Is there an inconsistency somewhere that prevents us from calling an exported function that returns a string from within the same library? I'm assuming that the ASM output is different between a Procedure and ProcedureDLL.

Would it be possible to keep the ASM the same so that we can call these functions again with TailBite?
Actually, there could be a solution on the compiler side. TailBaite creates pblibraries with the 'ASM' flags (in the .desc), right ?
Yes, that is correct.

Now, if you're saying that you may be able to adjust the compiler then I'm glad I halted my ammendments to coffIT! Foresight or what? :)
I may look like a mule, but I'm not a complete ass.
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Re: Calling exported string functions - PB 4.2 beta 2

Post by Droopy »

Hello, an asm guru can look @ this to fix this bug ?
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Re: Calling exported string functions - PB 4.2 beta 2

Post by Progi1984 »

Some news Droopy ?
Post Reply