Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!dalcs!aucs!peter From: peter@aucs.UUCP Newsgroups: comp.sys.ibm.pc Subject: Converting MicroSoft C to Turbo C Message-ID: <381@aucs.UUCP> Date: Thu, 18-Jun-87 08:25:34 EDT Article-I.D.: aucs.381 Posted: Thu Jun 18 08:25:34 1987 Date-Received: Fri, 19-Jun-87 02:52:19 EDT Reply-To: peter@aucs.UUCP (Peter Steele) Distribution: na Organization: School of Computer Science, Acadia Univ., Nova Scotia Lines: 68 I (finally) got my Turbo C; I'll give you my first impressions about the package in general, and then discuss my experiences in converting a somewhat large MicroSoft C program over to Turbo C. Overall, the documentation is poor. The installation procedure was scattered over several pages and the manuals appear to be poorly indexed. I am going to slice mine and put them in three ring binders... Some aspects of the installation are strange. For example, the default configuration file for the command line compiler is TURBOC.CFG while in the integrated environment it is TCCONFIG.TC. Furthermore, the first one is a text file while the other is a binary file. When the command line compiler loads up, it looks for TURBOC.CFG in the current directory and if it doesn't find it, it then looks in the "startup" directory (where TCC.EXE was found). To have this capability with the integrated environment, it is necessary to run a program (TCINST) which actually modifies the TC.EXE file--you have to tell it where to look for TCCONFIG.TC if it doesn't find it in the current directory. This all seems very strange to me. Fortunately, I was able to install the whole package exactly to my liking, even though the steps involved were not particularly logical. I compiled the spreadsheet demo without problems, and was certainly impressed by the speed. I've been using MicroSoft C lately, which is good but VERY slow. My current project is a 5000 line terminal emulator (tvi955). It isn't complete yet, and I debated whether the conversion to Turbo C would be reasonable at this stage. As an experiment, I decided to give it a quick try, and if it proved too time consuming, not bother. Well, an hour and a half later, the program was converted! There were essentially no problems. The only changes needed in the C code were to change the names of two include files (memory.h to mem.h and malloc.h to alloc.h), and change the calls to inp and outp to inportb and outportb. The compiler also found a bug which had gone undetected--I had the statement "memx == 0;" and it told me it didn't do anything. Of course, I really meant "=" not "==". The only major problem was with the assembler module (another 500 lines; interrupt stuff mainly). I had to convert certain symbols (_TEXT, _DATA, _BSS) to upper case and invoke masm with a /mx switch to make it case-sensitive (or I could have told Turbo C to compile externals as case-insensitive). Other than that, the assembler code remained unchanged. I did the whole conversion in the integrated environment (except for the assembler). I plan to convert the assembler module all to in-line (even the interrupt stuff). I also plan never to use MicroSoft C again. My general impressions? *Impressive!* Turbo C is the best development system I've used on a PC (it looks strangely like LightSpeed C on my Mac SE :-) ). I benchmarked Turbo C against MicroSoft C using my emulator. The program is 5200 lines, but when all include files are considered, amounts to 14000 lines of code that must be compiled. Under MicroSoft C, it took 17 minutes to compile and link the complete system (I ate my breakfast, read the morning paper, and shaved while I waited :-) ); under Turbo C in the integrated enviroment (I haven't tried compiling the whole thing under the command line package yet), it took 3 and a half minutes. 'Nuff said. Peter W. Steele UUCP : {seismo|watmath|utai|garfield}!dalcs!aucs!Peter Acadia University BITNET : {Peter|pws}@Acadia Wolfville, N.S. Internet : {Peter|pws}%Acadia.BITNET@WISCVM.WISC.EDU Canada B0P 1X0 PHONEnet : (902) 542-2201x121