Re: Compilers producing assembly language.

Tony Stuart <uunet.UU.NET!rlgvax!tony>
Tue, 15 Dec 87 12:18:31 est

          From comp.compilers

Related articles
Re: Compilers producing assembly language. uunet.UU.NET!rlgvax!tony (Tony Stuart) (1987-12-15)
| List of all articles for this month |

Date: Tue, 15 Dec 87 12:18:31 est
From: Tony Stuart <uunet.UU.NET!rlgvax!tony>

This discussion of compiler output is taking on the flavor of "my
compilation technique is better than yours." The issue of whether a
compiler should produce assembly language or machine code output
depends on the application:


1) Operating System Compiler Development


The goal of the operating system compiler development group
is to write a compiler that executes quickly and eventually
produces a machine language equivalent of the source code.
One can assume that the object file format and assembler
source code are available and can be incorporated into the
design of the compiler. It is not really necessary to produce
assembly language output.


2) Third Party Compiler Development


The goal of third party compiler development is to produce
a compiler that does something different or better than the
compilers supplied with the operating system. A major difference
between third party and operating system compiler development
is that the object file format and assembler source code may
not be available to the third party developers. Therefore, it
may be cost effective (in terms of development time and $$$) to
produce assembly language and let the assembler do the rest.


3) Academic Compiler Development


There are dozens of reasons for writing a compiler in an academic
environment. If the purpose is to explore compilation techniques
then assembly language or pseudo code output may be acceptable. If
the purpose is to explore compiler execution time optimization or
object code production then object code generation may be required.


4) Other Applications - Please Specify: __________


There are certainly many more reasons. The point is that certain
techniques are appropriate in certain cases and inappropriate in others.
My personal favorite, given a good macro assembler, is to output three
address code and subsequently assemble it using a macro library
written for the particular machine. It is easy to verify the compiler
output and it is quite portable. This approach resulted in acceptable
compilation times in an application where the compiler was used much
less frequently then the code it produced.


                Anthony F. Stuart, {uunet|sundc)!rlgvax!tony
                CCI, 11490 Commerce Park Drive, Reston, VA 22091
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.