[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article
Free access

The design of a space efficient compiler

Published: 01 August 1978 Publication History

Abstract

Writing a compiler for a small machine with minimal software support can be quite difficult because the program is long and debugging aids are usually inadequate. In addition, the usual techniques for compiler writing tend to produce programs which are quite large when compared to, for example, a BASIC interpreter. This frustrates efforts for producing compilers on small machines. We describe a method which can be used to reduce the size of a compiler and simultaneously provide good debugging tools. The resulting compiler sacrifices little in terms of execution speed (in part because compilers on minicomputers are often I/O bound). We have used this method to write an MPL [1] compiler for a Microdata 32/S minicomputer. The compiler requires approximately 12K bytes of memory as opposed to 32K bytes required by the compiler produced by the manufacturer, and compiles at essentially the same speed. Appendix II outlines the syntax of the MPL language and is included to illustrate the size of the language being compiled. MPL is based on PL/I and is quite similar to the PL/M* [2] language developed by the INTEL Corporation.
The method described here uses an interpretive language for writing the compiler. Thus the interpreter is the only machine language program written. We coded the interpreter in MPL and used a cross compiler to compile it, however, the interpreter could have been easily coded in assembly language. Figure 1 illustrates the savings of the interpretive language over machine code. The procedure IF_STAT is typical of a routine which might appear in a recursive descent compiler for MPL. The gain in space occurs because machine language instructions carry too much information content when applied to a special purpose (such as compiling). Note for example that a subroutine call for the Microdata requires 6 bytes, but all that is really needed is an opcode to indicate a call and a byte to indicate which of a few subroutines is to be called.

References

[1]
Microdata Corporation, "MPL Reference Manual", Sept. 1975.
[2]
Intel Corporation, "8008 and 8080 PL/M Programming Manual", 1975
[3]
Gries, D., Compiler Construction for Digital Computers, John Wiley and Sons, New York, New York, 1971

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGMINI Newsletter
ACM SIGMINI Newsletter  Volume 4, Issue 4
August 1978
124 pages
ISSN:0163-576X
DOI:10.1145/1014031
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 August 1978
Published in SIGMINI Volume 4, Issue 4

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)64
  • Downloads (Last 6 weeks)9
Reflects downloads up to 12 Dec 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media