From: Martynas Kunigelis Newsgroups: comp.os.msdos.djgpp Subject: Re: NASM w/DJGPP Date: Sat, 18 Jan 1997 13:36:24 +0000 Organization: LITNET Lines: 38 Message-ID: References: NNTP-Posting-Host: santaka.sc-uni.ktu.lt Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Fri, 17 Jan 1997, Matthew Mastracci wrote: > I downloaded the newest version of NASM from the project's homepage > (http://www.dcs.warwick.ac.uk/~jules/nasm1.html) and I was really > impressed with how well it worked with DJGPP. There are a few syntax > changes from regular MASM to NASM-format, but none of them we major enough > to cause me any trouble. One problem with the docs & examples in relation > to DJGPP: they don't mention that the DJGPP linker looks for postfixes to > all function calls, indicating what their arguments are. For example: > > C-definition: extern void greet(void) > NASM-function: _greet__Fv > > C-definition: extern int addfour(unsigned char, unsigned int, int, char) > NASM-function: _addfour__FUcUiic > > If you're ever in doubt, just check the compiled source to your program > and see what the linker will look for. > > BTW, to get the example program to work, just add "__Fv" to the ends of > the functions in the assembler source. > > Is there any way to change the linker's behavior (so it doesn't require > these postfixes)? > All you said applies to C++, not to C!!! It's called name mangling. So compile your sources as .c files, not as .cpp or whatever. If you're ever in doubt, just check the source compiled with this command line: gcc -x c -S test. Martynas