Page 1 of 1
NASM: Calling Externals
Posted: Fri Nov 10, 2006 4:35 pm
by Fear
I'm writing my kernel in NASM and compiling it into AOUT, which seems to have problems with my external functions. I can call functions in my other object files, but when I try and pass parameters, the can't be popped off the stack. In fact, neither push nor pop work in external procedures. How do I get it to work properly?
Re: NASM: Calling Externals
Posted: Fri Nov 10, 2006 5:22 pm
by Candy
Fear wrote:I'm writing my kernel in NASM and compiling it into AOUT, which seems to have problems with my external functions. I can call functions in my other object files, but when I try and pass parameters, the can't be popped off the stack. In fact, neither push nor pop work in external procedures. How do I get it to work properly?
Do you use a Windows-output-generating compiler? If so, are you using stdcall or cdecl calling convention?
Is your stack valid?
Why do you use a.out as output file type?
Re: NASM: Calling Externals
Posted: Fri Nov 10, 2006 5:24 pm
by Brynet-Inc
Candy wrote:...
Why do you use a.out as output file type?
Why else? Because it's a lovely executable format.. NetBSD/OpenBSD's a.out format was anyway.
People still use ancient DOS formats in OSDev, What's wrong with using historic UNIX binary formats?
Re: NASM: Calling Externals
Posted: Fri Nov 10, 2006 5:43 pm
by Candy
Brynet-Inc wrote:Candy wrote:...
Why do you use a.out as output file type?
Why else? Because it's a lovely executable format.. NetBSD/OpenBSD's a.out format was anyway.
People still use ancient DOS formats in OSDev, What's wrong with using historic UNIX binary formats?
The same as with ancient DOS formats
. Knowing a murderer doesn't make it right to be a thief, as a matter of speech.
Re: NASM: Calling Externals
Posted: Sun Nov 12, 2006 8:23 pm
by smiddy
Candy wrote:The same as with ancient DOS formats
. Knowing a murderer doesn't make it right to be a thief, as a matter of speech.
You
are so analogical it hurts!