It is currently Wed Oct 18, 2017 1:20 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Wed May 28, 2008 1:09 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13108
Location: France
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 28, 2008 1:18 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3103
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?

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 28, 2008 2:52 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3103
Removed by Mistrel. (I fixed the problem)

_________________
Image


Last edited by Mistrel on Fri May 30, 2008 8:04 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 28, 2008 8:46 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10287
Location: Beyond the pale...
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 28, 2008 9:49 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13108
Location: France
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 ?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 28, 2008 9:55 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10287
Location: Beyond the pale...
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling exported string functions - PB 4.2 beta 2
PostPosted: Fri Mar 18, 2011 12:02 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 16, 2004 9:50 pm
Posts: 658
Location: France
Hello, an asm guru can look @ this to fix this bug ?

_________________
DroopyLib/PBFastLib/HMod


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling exported string functions - PB 4.2 beta 2
PostPosted: Mon Jul 25, 2011 2:10 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Feb 25, 2005 1:01 am
Posts: 806
Location: France > Normandy > Near Caen
Some news Droopy ?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye