Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: Calling lib...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 22 Topic 4620 of 4729
Post > Topic >>

Re: Calling libraries from assembler.

by Frank Kotler <spamtrap@[EMAIL PROTECTED] > Apr 21, 2008 at 05:49 AM

Terence wrote:
> A misunderstanding Frank!
> I know the posting is about the use of Linux.
> And an ASM program written as a main can call named sub-programs,
> whether service or otherwise.
> 
> But this same main program can be used with Windows as long as what
> its calls are valid for a Windows environment.
> 
> And here is the point.
> When you write a 32-bit algorithm in ASM for an Intel chip, the main
> code is valid whether for Windows or Linux, EXCEPT the calls to
> services.
> 
> And I write for DOS and Windoss and change the subprogram library I
> link with to match.
> But I have also to match the calling convention or use a common one.
> And FOrytran and C, as example, use different stack conventions.

I'm not familiar with Fortran. How do they do it?

> In Linux the usage is to push parameters to the stack and call a
> subprogram service, and on return, to clear the stack space used.
> Microsoft's original preffered scheme was to have the called
> subprogram clear the stackk on return.

Right... AFAIK, they still do it that way, with a couple exceptions - 
"wsprintf", I think... probably more...

Unless I'm mistaken, changing ".model flat stdcall" to ".model flat C" 
would automatically adjust your code... with certain assemblers...

Best,
Frank
 




 22 Posts in Topic:
Calling libraries from assembler.
SoLo2 <spamtrap@[EMAI  2008-04-18 18:43:51 
Re: Calling libraries from assembler.
(Gordon Burditt) <spam  2008-04-18 23:22:54 
Re: Calling libraries from assembler.
Josef Moellers <spamt  2008-04-21 08:50:12 
Re: Calling libraries from assembler.
Frank Kotler <spamtra  2008-04-19 08:29:23 
Re: Calling libraries from assembler.
SoLo2 <spamtrap@[EMAI  2008-04-19 18:41:12 
Re: Calling libraries from assembler.
Terence <spamtrap@[EM  2008-04-20 15:33:52 
Re: Calling libraries from assembler.
Frank Kotler <spamtra  2008-04-21 00:33:57 
Re: Calling libraries from assembler.
santosh <spamtrap@[EM  2008-04-21 07:31:41 
Re: Calling libraries from assembler.
Robert Redelmeier <red  2008-04-21 02:04:02 
Re: Calling libraries from assembler.
Frank Kotler <spamtra  2008-04-21 05:25:02 
Re: Calling libraries from assembler.
"James Van Buskirk&q  2008-04-21 11:46:30 
Re: Calling libraries from assembler.
"robertwessel2@[EMAI  2008-04-20 19:20:38 
Re: Calling libraries from assembler.
Terence <spamtrap@[EM  2008-04-20 21:12:02 
Re: Calling libraries from assembler.
Frank Kotler <spamtra  2008-04-21 05:49:00 
Re: Calling libraries from assembler.
Robert Redelmeier <red  2008-04-21 14:25:53 
Re: Calling libraries from assembler.
Josef Moellers <spamt  2008-04-22 09:44:41 
Re: Calling libraries from assembler.
Josef Moellers <spamt  2008-04-22 09:42:38 
Re: Calling libraries from assembler.
Terence <spamtrap@[EM  2008-04-22 15:18:31 
Re: Calling libraries from assembler.
David Thompson <spamt  2008-05-05 04:10:33 
Re: Calling libraries from assembler.
"H. Peter Anvin"  2008-05-05 11:06:21 
Re: Calling libraries from assembler.
(Scott Lurndal) <spamt  2008-05-05 23:41:16 
Re: Calling libraries from assembler.
"H. Peter Anvin"  2008-05-12 23:44:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:20:07 CDT 2008.