From: Mateusz Papiernik on
Hi there,

I'm trying to solve a problem I can't seem to get over. I have some
stuff written in TASM which I am able to link with C/C++ programs using
Turbo C++/Turbo Assembler/TLINK toolchain under DOS (under Virtual PC).
I'm trying to find a way to link OBJs made with TASM using current
linkers, so I would be able to use current C++ compilers as well -
supporting namespaces and STL. I have stumbled upon a serious trouble
there. LD from GCC toolchain doesn't support TASM OBJs, only COFF
format. Visual C++ LINK theoretically can link with OMF OBJs, it throws
"Invalid or corrupt file: cannot read at 0x1D9" when trying to link with
somestuff.obj from TASM. Is there any way I could go through this
problem? The code SHOULD stay as is, in TASM, but I'd like to run it
under windows and current C++ programs. Is getting friendly with NASM
and rewritting the code is the only possibility?


Thanks for all help,
--
Mateusz Papiernik, Maticomp Webdesign
Projektowanie i realizacja witryn WWW
mati(a)maticomp.net, http://www.maticomp.net
"One man can make a difference" - Wilton Knight
From: Rugxulo on
Hi,

On Apr 19, 12:27 pm, Mateusz Papiernik <m...(a)maticomp.net> wrote:
> Hi there,
>
> I'm trying to solve a problem I can't seem to get over. I have some
> stuff written in TASM which I am able to link with C/C++ programs using
> Turbo C++/Turbo Assembler/TLINK toolchain under DOS (under Virtual PC).

So it's DOS-based, 16-bit stuff? All of it?

> I'm trying to find a way to link OBJs made with TASM using current
> linkers, so I would be able to use current C++ compilers as well -

In other words, compiling different modules via different compilers
for the same program?

> supporting namespaces and STL. I have stumbled upon a serious trouble
> there. LD from GCC toolchain doesn't support TASM OBJs, only COFF
> format.

MinGW or DJGPP? Anyways, my only guess for that is to try Agner's
OBJCONV (Win32 .EXE but works in DOS via HXRT), but I've honestly
never used it (so it may not be able to convert 16-bit stuff, I
dunno):

http://www.agner.org/optimize/#objconv
http://www.japheth.de/HX.html

> Visual C++ LINK theoretically can link with OMF OBJs, it throws
> "Invalid or corrupt file: cannot read at 0x1D9" when trying to link with
> somestuff.obj from TASM. Is there any way I could go through this
> problem?

You could always try a few different .OBJ linkers to see if they
handle better.

* WLINK: http://www.openwatcom.org/index.php/Alternative_Open_Watcom_distribution
* QLINK: http://www.sudleyplace.com/qlink/
* ALINK: http://alink.sourceforge.net/download.html
* VALX: http://ladsoft.tripod.com/cc386.htm (part of
CC386)
* WarpLink: http://www.devoresoftware.com/freesource/mainsrc.htm

> The code SHOULD stay as is, in TASM, but I'd like to run it
> under windows and current C++ programs. Is getting friendly with NASM
> and rewritting the code is the only possibility?

No, but I'm not sure exactly what you should do here. It sounds like
you need a real C++ guru with DOS experience (which I'm not). Or maybe
try Digital Mars C++, which still supports DOS (and might be more
modern than OpenWatcom, I dunno, but they both support .OBJ at least
unlike DJGPP, but DJGPP is definitely more modern C++ than OpenWatcom).