Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!husc6!spdcc!mirror!prism!rob From: rob@prism.TMC.COM Newsgroups: comp.sys.ibm.pc Subject: Re: Mixed-language Programming Message-ID: <206900146@prism> Date: 14 Dec 89 15:26:00 GMT References: <1272@amethyst.math.arizona.edu> Lines: 23 Nf-ID: #R:amethyst.math.arizona.edu:-127200:prism:206900146:000:1157 Nf-From: prism.TMC.COM!rob Dec 14 10:26:00 1989 >I want to link a C(Borland Turbo C) routine with a >BASIC routine under Microsoft 3.3... >Does the C compiler use the same calling >convention as the BASIC? I'm not much of an >expert on BASIC, or is it the case that the two compilers >use different conventions... There are things you need to watch out for, but it can be done without too much trouble. As you suspected, BASIC and C use different calling conventions, but many newer compilers (of both languages) let you modify the calling convention on a function-by-function basis, which makes it relatively simple for different languages to communicate. The best reference I've seen on this subject is a Microsoft document called the 'Mixed-Language Programming Guide'. It covers everything you need to know to make this work. Trouble is, the only way I know of getting it is to buy a Microsoft compiler. I don't know if Borland publishes something similar. The Microsoft document obviously deals with Microsoft products, but Turbo C and Microsoft C are very similar in terms of calling convention, segment setup, etc., so most of what you read about one should apply to the other.