Need to optimize 8086 C code for size 
Author Message
 Need to optimize 8086 C code for size

I have a friend who is doing some development work for the 8086 PC market.
He needs to optimize for size, since the 640K limit is posing some almost
insurmountable problems.

Here are his experiences so far:

He is using Microsoft C 4.0 currently.  Unfortunately, when he turns the
optimizer on it produces incorrect (albiet shorter) code.  If he turns the
optimizer off the executable becomes too big.  He has tried Microsoft C 5.0,
but in his initial estimates 5.0 code optimized is about the same size as 4.0
unoptimized.  He is going to try Turbo C 1.5 to see if there are any
improvements.  BTW, he is using an 80386 machine for development, so size isn't
as important there; however, he needs to produce 8086 code that will run on a
640K PC.

What is the best C compiler on the market today for optimizing size?  Any
comparisons between compilers would be greatly apprieciated.

Thanks alot (in advance),
 _ __                   NEVIN J. LIBER  ..!ihnp4!ihlpf!nevin1   (312) 510-6194
' )  )                          "The secret compartment of my ring I fill
 /  / _ , __o  ____              with an Underdog super-energy pill."
/  (_</_\/ <__/ / <_   These are solely MY opinions, not AT&T's, blah blah blah

Mon, 20 Jul 1992 00:48:00 GMT  
 Need to optimize 8086 C code for size

>What is the best C compiler on the market today for optimizing size?  Any
>comparisons between compilers would be greatly apprieciated.

I am currently comparing  Computer Innovations  C86 version 2.3J,
Turbo-C version 1.5, and MSC 5.0 for a database application which
keeps everything in core.  Code size is critical because code and
data compete for the same memory.  Turbo-C  seems to be the clear
winner in size of the EXE file (about 10% smaller).  But, Turbo-C
seems  to use a memory  allocation  scheme  which takes  25% more
space for the size items  I allocate  than does CI86,  which more
than wipes out the initial memory savings.   I'm not sure how MSC
compares  in this regard because it seems to only have a function
which reports  the space remaining  in the default  data segment,
ignoring the far heap space.  These results are only preliminary,
as I have only had Turbo-C  and MSC for a few weeks.   (CI86  has
been replaced by C86PLUS, and may not be available  any more.  As
of  the  middle  of  last  year,  C86PLUS  was  not  a functional
compiler,  but that has probably  changed  by now, and they  were
claiming great things about it.)

Anyway, code size is not the only consideration if the program in
question allocates a lot of memory.

Mon, 20 Jul 1992 09:54:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Optimizing loops on 8086

2. Aztec C (8086 version) - producing ROMable code

3. small-c/8086 code generator wanted

4. Need very small C compiler for 8086

5. newbe/cs student, need help w/ code

6. Optimizing random number generator (was Re: Optimizing code for tests)

7. Need help optimizing a piece of code

8. Need to optimize C code

9. Free 8086 C compiler

10. Searching for ansi-c-compiler for 8086

11. 8086 Interrupt handlers

12. Looking for GUI libraries for IBM 8086


Powered by phpBB® Forum Software