NASM: Calling Externals
NASM: Calling Externals
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
Do you use a Windows-output-generating compiler? If so, are you using stdcall or cdecl calling convention?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?
Is your stack valid?
Why do you use a.out as output file type?
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: NASM: Calling Externals
Why else? Because it's a lovely executable format.. NetBSD/OpenBSD's a.out format was anyway.Candy wrote:...
Why do you use a.out as output file type?
People still use ancient DOS formats in OSDev, What's wrong with using historic UNIX binary formats?
Re: NASM: Calling Externals
The same as with ancient DOS formats . Knowing a murderer doesn't make it right to be a thief, as a matter of speech.Brynet-Inc wrote:Why else? Because it's a lovely executable format.. NetBSD/OpenBSD's a.out format was anyway.Candy wrote:...
Why do you use a.out as output file type?
People still use ancient DOS formats in OSDev, What's wrong with using historic UNIX binary formats?
- smiddy
- Member
- Posts: 127
- Joined: Sun Oct 24, 2004 11:00 pm
- Location: In my cube, like a good leming. ;-)
Re: NASM: Calling Externals
You are so analogical it hurts!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.