delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/18/12:03:01

From: Martynas Kunigelis <algikun AT santaka DOT sc-uni DOT ktu DOT lt>
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: <Pine.HPP.3.95.970118133339.8186B-100000@santaka.sc-uni.ktu.lt>
References: <Pine DOT A41 DOT 3 DOT 94 DOT 970117160732 DOT 73886D-100000 AT acs2 DOT acs DOT ucalgary DOT ca>
NNTP-Posting-Host: santaka.sc-uni.ktu.lt
Mime-Version: 1.0
In-Reply-To: <Pine.A41.3.94.970117160732.73886D-100000@acs2.acs.ucalgary.ca>
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.<whatever your extension is>


Martynas


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019