Board index » cppbuilder » Using NASM and Borland C++ 5.01

Using NASM and Borland C++ 5.01


2004-02-12 02:12:19 AM
cppbuilder109
Has anyone gotten NASM to work with Borland c++ 5.01?
I've gotten NASM to generate .obj files, but when I link
the linker complains about defined symbols. (These are
symbols that I define in my assembler code)
Is there any documentation about how to use BC 5.01
with an assmbler?
Thanks,
Philip Knodle
 
 

Re:Using NASM and Borland C++ 5.01

Each symbol has a public name, the name that will be used by the linker. C
public names are the same as in the source code except that a leading
underscore has been added. C++ public names are formed differently. So if
you have this function prototype:
int MyFunc(int i);
The C public name would be _MyFunc but the C++ one might look something like
@MuFunc$qi
However if the function prototype in C++ code were this:
extern "C"
int MyFunc(int i);
Then the public name would be formed as if it were C langugage and might
match up with the public symbol from your assembly source file.
. Ed
Quote
Philip Knodl wrote in message
news:402a707a$ XXXX@XXXXX.COM ...

Has anyone gotten NASM to work with Borland c++ 5.01?
I've gotten NASM to generate .obj files, but when I link
the linker complains about defined symbols. (These are
symbols that I define in my assembler code)
Is there any documentation about how to use BC 5.01
with an assmbler?
 

Re:Using NASM and Borland C++ 5.01

Quote
Has anyone gotten NASM to work with Borland c++ 5.01?
I've gotten NASM to generate .obj files, but when I link
the linker complains about defined symbols. (These are
symbols that I define in my assembler code)
Is there any documentation about how to use BC 5.01
with an assmbler?
1, If you want to call the assembly function from C, you should declare
the function name with a '_' prefix. When calling it from C, don't include
the '_'.
For example, you can declare a function in assembly like _MyFunc,
then call it from C, MyFunc(...).
2, If you really want to get an assembler work with BC++, TASM or LZASM
is a better choice.
*****Pardon my poor English*****
---------------------
My TASM homepage, resource for assembly. Tools, articles, links.
komsbomb.ols-lab.com
 

{smallsort}