17.05.2015 Views

Pascal News

Pascal News

Pascal News

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Articles<br />

Abstract<br />

The Performance of Three CP/M-Based <strong>Pascal</strong> Translators<br />

Mark Scott Johnson and Thomas O. Sidebottom<br />

106 Mission Drive<br />

Palo Alto. California 94303<br />

1981 October<br />

The translation-time .md run-time performance of three CP/M-based<br />

<strong>Pascal</strong> translators - Sorcim's <strong>Pascal</strong>/M. MT MicroSYSTEMS' <strong>Pascal</strong>/MT+, and<br />

Ithaca InterSystems' <strong>Pascal</strong>/Z - are compared. Using a benchmark of eight<br />

programs on a 4MHz Z80-based microprocessor. we find that <strong>Pascal</strong>/M excels<br />

in translation time and that <strong>Pascal</strong>/Z excels in run time. <strong>Pascal</strong>/MT+'s<br />

translation time approaches that of <strong>Pascal</strong>/M for long programs. Several<br />

translator limitations are also illustrated by the benchmark.<br />

Introduction<br />

We recently had the opportunity to use and evaluate four<br />

mlcropro .essor-based <strong>Pascal</strong> translators. We are reporting here the results of<br />

one asped of this evaluation (namely. performance) for three of them.<br />

The performance of a piece of software. such as a programming language<br />

translator. is measured in terms of the amount of resources required by the<br />

software to produce some useful result. The primary resource we are<br />

interested In is time. We measured both the time required to translate a<br />

source program into a machine-executable form and the time required to<br />

execute the translated program. The former is termed translation time and<br />

the latter run time (or execution time).<br />

The three <strong>Pascal</strong> translators we evaluated are Sorcim's <strong>Pascal</strong>/M.<br />

MT MicroSYSTEMS' Pucal/MT+. and Ithaca InterSystems' <strong>Pascal</strong>/Z. All three<br />

run under Digital Research's CP/M operating system. We also evaluated a<br />

fourth translator. the UCSD <strong>Pascal</strong> system. which runs under its own<br />

operating system. We have excluded UCSD <strong>Pascal</strong> from our report because we<br />

do not feel a fair comparison of translator performance can be made across<br />

operating systems. Separating the performance attributable to the operating<br />

system from that attributable to the translator is a difficult task. Other<br />

translators beside these three run under CP/M. however. We limited the<br />

study to translators that accept essentially the full <strong>Pascal</strong> programming<br />

language and that are widely accessible to the general microcomputing public.<br />

Not-for­<br />

Copyright c 1981, Mark Scott Johnson and Thomas O. Sidebottom.<br />

profit reproduction is permitted; all other rights are reserved.<br />

Thus we eliminate from consideration several "tiny" <strong>Pascal</strong> translators. among<br />

others.<br />

Translators<br />

To better understand the behavior of the three <strong>Pascal</strong> translators and to<br />

better appreciate the performance results. we begin with a brief introduction<br />

to translator construction. We use translator in the generic sense - any<br />

software system that accepts as input a program in one language (the source<br />

language) and that produces as output a functionally equivalent program<br />

written in another language (the object language). If the source language is<br />

a high-level language such as <strong>Pascal</strong> and the object language is a low-level<br />

language such as assembly language or machine language. then the translator<br />

is called a compiler. If both the source and the object languages are lowlevel.<br />

then the translator is called an assembler. If the object language is<br />

not the machine language of some real machine. it becomes necessary to<br />

execute the object code with an interpreter. which simulates the object<br />

language on a real computer.<br />

Compilers that translate source programs directly into object programs<br />

are called one-pass compilers. Sometimes compilers are written to perform<br />

one or more intermediate transformations between source and object; these are<br />

called multi-pass compilers. Multi-pass compilers generally take longer than<br />

one-pass compilers. but they often require ·Iess 'llain memory, compile longer<br />

source programs, provide more complete diagnostics. and generate better<br />

object code. To conserve main memory (and again to increase the size of<br />

source programs that can be translated), multi-pass compilers often write out<br />

their intermediate transformations to temporary disk files.<br />

We used version 3.19 of the <strong>Pascal</strong>/M translator. It is patterned after<br />

the UCSD <strong>Pascal</strong> system. comprising two components: a compiler that<br />

translates a <strong>Pascal</strong> source program into P-code - object code for a fictitious.<br />

<strong>Pascal</strong>-like P-machine - and an interpreter for the P-machine. It is a onepass<br />

compiler written in <strong>Pascal</strong>. For short and moderately-sized programs the<br />

compiler uses no memory overlays. but long programs require swapping from<br />

the disk of segments of the compiler. It runs in 56K of main memory and<br />

requires no temporary files. The output from the compiler is a file containing<br />

P-code instructions, which is input to the p.-machine interpreter. For<br />

compactness and efficiency. the interpreter is written in the assembly<br />

language of the host computer (a Zilog Z80, in our case).<br />

We used version 5.2 of the <strong>Pascal</strong>/MT+ translator. It is a true compiler<br />

that generates object code for any of several microprocessors. including the<br />

Z80. It is a three-pass compiler written in <strong>Pascal</strong>: the first pass converts a<br />

source program into a sequence of logically related characters called tokens.<br />

the second pass builds a symbol table. and the third pass generates object<br />

code and places it in a Microsoft-format. relocatable object file. The compiler<br />

runs in 56K of main memory. using five memory overlays. and it uses one<br />

temporary file for the tokens.<br />

."<br />

»<br />

'"<br />

V'1<br />

o

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!