Path: utzoo!utgpu!water!watmath!clyde!ima!johnl Newsgroups: comp.compilers Subject: Re: Compilers producing assembly language. Message-ID: <794@ima.ISC.COM> Date: 15 Dec 87 17:18:31 GMT Sender: johnl@ima.ISC.COM Reply-To: Tony StuartLines: 52 Approved: compilers@ima.UUCP 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 -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request