🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2547

Need compiler for 386 code for DOS

#2547
From: Nelson Bolyard
Date: Tue, 02 Oct 1990 16:17
48 lines
3092 bytes
I have an application which uses long integer arithmetic extensively.
I have compiled and run this application on my 25 Mhz 386 clone with 
Turbo C 2.0 and also on a 20 Mhz MIPS system.  The performance on the 
386 system is about 1/20th of the performance on the MIPS.  When I look at
the assembly code generated by each compiler, the reason for the speed
difference becomes obvious - there are at least 6 8086 instructions being
generated for each 1 mips instruction.  This is not a complaint about Turbo
C's optimization.  This is mainly due to the 16-bit registers in the 8086
model.  

I want to be able to use the 32-bit registers on the 386.  To do this, I
need a c compiler that will generate 386 instructions.  The entire
application runs now in Turbo C's tiny model, so memory space is not an
issue.  I don't need to use the 386 descriptor tables; that is, 8086 style 
memory addressing is just fine,  I only need wider registers.

I've heard of things called "DOS Extenders", but they're always advertised
as existing to solve problems caused by the 8086's 1 MB memory limit - which
is not my problem.  The Turbo Debugger manual states that with the "virtual
debugger device driver" tdh386 (which I use all the time) "Your program can
use nearly all the 80386 instructions, with the exception of the
protected-mode instructions CLTS, LMSW, LTR, LGDT, LIDT, LLDT."

So my questions are these:
1. Do I need a dos extender to be able to use the 32-bit registers?
   Evidently not if I'm using TD386H, but what about when I'm not 
   debugging the program?  I might want to someday sell this program, so I
   want a solution that won't require every customer to buy a DOS extender.

2. Where can I get a c compiler that will generate code that uses the 32-bit
   386 registers efficiently, but still use DOS for I/O?  I guess I could
   buy some flavor of UNIX/XENIX as these come with 386 compilers, and 
   reportedly some flavors run DOS as a process, but this seems like a big
   investment to reach my simple goal.

3.  Turbo C has a compiler option to generate 186/286 instructions, that
    I've never used.  What does that do for me?

4.  Do you have any suggestions?

Please e-mail your responses to me at the address below, and I will
summarize to the net, if asked to do so.
Thanks in advance for your replies.

-----------------------------------------------------------------------------
Nelson Bolyard      nelson@sgi.COM      {decwrl,sun}!sgi!whizzer!nelson
Disclaimer: Views expressed herein do not represent the views of my employer.
-----------------------------------------------------------------------------
Technical Details
Message-ID: <1990Oct2.161712.20942@odin.corp.sgi.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!sgi!shinobu!odin!bolyard.wpd.sgi.com!nelson

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!sgi!shinobu!odin!bolyard.wpd.sgi.com!nelson
From: nelson@bolyard.wpd.sgi.com (Nelson Bolyard)
Newsgroups: comp.os.msdos.programmer
Subject: Need compiler for 386 code for DOS
Message-ID: <1990Oct2.161712.20942@odin.corp.sgi.com>
Date: 2 Oct 90 16:17:12 GMT
Sender: news@odin.corp.sgi.com (Net News)
Organization: Silicon Graphics, Inc., Mountain View, CA
Lines: 48