Newsgroups: comp.lang.pascal
Path: utzoo!utgpu!watserv1!maytag!watstat.waterloo.edu!dmurdoch
From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch)
Subject: Re: TC++ <-> TP 6.0 Mixed Language Development
Message-ID: <1991Apr5.144615.25208@maytag.waterloo.edu>
Sender: news@maytag.waterloo.edu (News Owner)
Organization: University of Waterloo
References: <45670006@hpcupt3.cup.hp.com>
Date: Fri, 5 Apr 1991 14:46:15 GMT
Lines: 39

In article <45670006@hpcupt3.cup.hp.com> defaria@hpcupt3.cup.hp.com (Andy DeFaria) writes:
>Is it  possible to  call Turbo  Pascal  6.0  functions from Turbo C++?  

Probably possible, but not really practical.  The linker that TC++ uses
(TLINK?) doesn't understand the object format (.TPU) that TP uses.  The
only way to do it would be to get around this limitation; it's not easy.

>I  can't believe that Borland would  choose the   keyword "pascal" to  mean
>"interface  to   assembler".  Gee, wouldn't   a  better keyword  have  been
>"assembler"?

I think Pascal is something of a standard to define the convention that
parameters are pushed onto the stack starting on the left, and that the
routine that gets called is responsible for removing them.  Assembler 
doesn't have conventions - you can do whatever you like there.

>I also can't believe that Borland's Turbo C++ product would not be able to
>interface cleanly and easily to Borland own  Turbo Pascal product and given
>the fact that  there is probably a  large  amount of perfectly   good Turbo
>Pascal code out there  that could be migrated to   Turbo C++  a piece  at a
>time, I   would think  that somebody   has   a workaround to this   obivous
>oversight on Borlands part.

I don't know of any workarounds.

>
>Does anybody know more about this?
>
>Oh, and how would you go the other way around (TP 6.0 -> TC++)?

The other way is a little easier, because the TP linker (built in to TURBO
or TPC) has a limited understanding of .OBJ files.  There are tons of 
restrictions though - it doesn't even understand .LIB files.  

In my experience, it's much less headache to just go ahead and translate
the code than it is to mix languages.

Duncan Murdoch
   dmurdoch@watstat.waterloo.edu
