Source texts of compilers
Most stuff listed here is written by
rare enthusiasts for educational purposes or even for amusement. Due to
numerous causes (laziness or lack of spare time, possibly) most of these
projects were abandoned half done or even at the very beginning. Thats why
many of them lack functionality and capabilities. Nevertheless, they are
suitable as good examples for education.
|
Apropos some particularities. The
majority of developers had solved the output format problem enough easy; not
wanting to deal with object and executable files specifications, they had
changed the output to simple and plain assembler text listing. Due to that
youll need any other assembler and, possibly, a linker. To my mind its the
most suitable solution, cause one can do with this listing whatever he wants.
|
Almost
all archives contain the compiled executables (if the contrary is not
affirmed).
|
Basic
|
bas2nasm.zip
(~17kb) QuickBasic to Nasm compatible compiler v1.13 (c) 2003 by Nicholas Dark
|
A
tiny toy-compiler from QuickBasic compatible language to Nasm opcodes. The
capabilities are not impressive. An example program is applied. No .exe
compiled.
|
Source
text: .bas (QuickBasic v7.1)
|
Output
laguage: .asm (16-bit => Nasm => .com, mz .exe)
|
Home
page: http://b2nasm.sourceforge.net/
|
basic.zip (~81kb)
Basic compiler for MenuetOS (c) by Jarek Pelczar
|
As you can judge by name, its a Basic compiler.
Actually, this one is included to distribution package of alternative 32-bit
operating system named Menuet, but let
it be here for safety. It produces 32-bit machine code for protected addressing
mode (of Menuet, not Dos), but one can make even a .com executable. Also
remark: while evaluating the mathematical expression this program emits greatly
unoptimized asm instructions, identically to the student compilers do (look
below).
|
Source
text: .c (GNU C)
|
Output
language: .asm (32 bit => Nasm, Fasm => .bin, .com)
|
Documentation:
none, few comments in English
|
basmv650.zip
(~797kb) The BASIC to 286 Assembly Language Translator v6.50 (c) 1998 by Kevin
Diggins.
|
Another
Basic clone. This zip is one of a multitude findable in Internet and is
thought to be the last version. An IDE with the help files and an Arrowsoft
assembler are added. Also one can find a bunch of examples. Just as Sphinx C--,
Basm286 evaluates mathematical expressions left to right, regardless of
operation precedence.
|
Source
text: .bas (Power Basic 3.2)
|
Output
language: .asm (16 bit => Arrowsoft asm => mz .exe, .com)
|
Documentation:
in English
|
bxbsrc.zip (~120kb)
Blunt Axe Basic v1.052a (c) 2001-2004 by Sarbayo
|
This
is a QuickBasic/RapidQ subset. Yet Bxbasm can compile Win32 console-mode executables
only. Note that Bxbasm in its assembler output uses many inner Masm32 macros
such as invoke, .if-.else-.endif etc. The full package (with Masm32 about
2.5Mb) can be downloaded from the home page.
|
Source text: .c (Lcc-Win32)
|
Output: .asm (32-bit => Masm32 => pe .exe)
|
Home page: http://www.geocities.com/blunt_axe_basic/
|
Documentation: in English
|
gabasic.zip
(~410kb) GABasic v0.30 Beta 2(Public) (c) 2000 by Gabriel Fernandez
|
This
one was intended to be QuickBasic compatible but failed, there are no operation
precedence! GaBasic generates 32-bit asm listing to be run under WDosX
extender. Unfortunately, this projects is abandoned but it was a few steps to
reach self-recompilation!
|
Source
text: .bas (QuickBasic v4.5 v7.1)
|
Output
language: .asm (32 bit => Nasm => WDosX .exe)
|
Home
page: http://gab_soft.tripod.com/
|
Documentation:
in English
|
mrock50.zip
(~551kb) MoonRock Basic Compiler v0.50 (c) 1994-1998 by Rowan Crowe
|
This
was created as an alternative to QuickBasic. This compiler generates rather
compact asm listing and, as a result, small executables. In opposite to other
languages, expressions are evaluated left to right, regardless of operation
precedence (as in Sphinx C--).
|
Source
text: .bas (QuickBasic v4.5 v7.1)
|
Output
language: .asm (16-bit => Tasm, Masm => mz .exe, .com)
|
Home
page: http://www.rowan.sensation.net.au/moonrock.html
|
Documentation:
in English
|
newbasic.zip
(~138kb) Free QuickBasic compatible compiler (c) 1998 by Marcel Smolenaars
|
Its a very cute implementation of
Basic-like compiler. The syntax is close to that of QuickBasic. Supported:
subroutines/functions, local/global data, whole types (arrays partially),
almost all program flow constructs. But it lacks standard libraries and such
keywords as PRINT, DRAW cant be used. Though this compiler handles complex
expressions like n=(x*(20-b/a)-function1(a*b,x*(z-y),b)) with all priorities
and emits enough optimized code (without that spaghetti pushs and pops!) The
output format is plain asm listing.
|
Source
text: .bas (MS QuickBasic PDS v7.1)
|
Output
Language: .asm (16-bit => Tasm, Masm => mz .exe)
|
Home
page: http://www.geocities.com/SiliconValley/Park/9751/
|
Documentation:
comments in English
|
sbasic20.zip
(~60kb) SBasic 2.0 (C) 1989-91 DMV Widuch GmbH & Co.KG; Autor: Wolfgang
Lorenz (ASCII-/LABEL-BASIC-Preprocessor: Peter Knappe)
|
Have
you ever seen a compiler written in GW-Basic? You think its impossible? Turn
on your imagination! Not working? Then take a look at this stuff and let it be
your everlasting nightmare!.. This compiler accepts an input language similar
to GW-Basic, moreover its written in it itself! A little IDE is also included
with its own sources (of course in GW-Basic).
|
Source
text: .bas (à la GW-Basic, compiles itself)
|
Output
format: mz .exe
|
Documentation:
none
|
smc.zip (~167kb)
Steinis Mini Compiler (c) 2002 by Sebastian Steinhauer
|
Another
toy-compiler for language very close to Pascal and Basic.
|
Source
text: .bas (PowerBasic)
|
Output
language: .asm (16-bit => Nasm => mz .exe)
|
Documentation:
comments in German and English
|
ubasic031.zip
(~440kb) UltraBasic v 0.31a (c) 2000 by Gabriel Fernandez, 2004 by Angelo
Rosina
|
The
successor of GaBasic. It is compatible with QuickBasic as closely as its
possible in protected mode: all math expression are evaluated according to operation
priorities. The support for Win32 console executables is added! (Probably the
creation of windowed exes is possible). The libraries are tuned greatly, the
sources of them are included. As can be guessed, the new author is busy
expanding the capabilities of the compiler, the latest news are posted on his
homepage.
|
Source
text: .bas (QuickBasic v4.5 v7.1)
|
Output
language: .asm (32 bit => Nasm => WDosX .exe, pe .exe)
|
Documentation:
in English
|
Home
page: http://www.geocities.com/angros47/
|
C
|
bcc.zip (~206kb) BCC () 1992 by Bruce Evans
|
Unfortunately,
theres no any complete documentation, so nothing can be said apropos. Its
clear only that it is a C-like compiler which can emit an asm listing for
Motorola 6809 and Intel 8086/386 processors (16 and 32 bit). There are several
examples attached. Youll need also an assembler as.zip
(~125kb) and a linker ld.zip (~26kb) (the latter
isnt compiled though). The full sources with MS-DOS binaries can be found on
home page.
|
Source
text: .c (GNU C)
|
Output
language: .asm (16, 32-bit => AS=> mz, pe .exe)
|
Documentation:
comments in English
|
Home
page: http://www.cix.co.uk/~mayday/dev86/
|
bflat050.zip
(~310kb) B-flat "C" Compiler v0.50 (c) 1998, 2000 by Ken Martwick
|
A
C-like language called with the adequate shortness as B. Possibly, due to the
fact that its only a subset of the previous. It can emit 32-bit code for WDosX
extender though.
|
Source
text: .c (GNU C)
|
Output
language: .asm (32-bit =>Nasm, Fasm => WDosX .exe)
|
Documentation:
in English
|
c2asm.zip
(~249kb) C to ASM Compiler (c) 2003 by Muhammad Owais Khan Afridi
|
Minimalistic
C-like compiler created by some Pakistani student as his project on a compiler
construction course. The outputted code is non optimized greatly. Some examples
and a detailed description of intrinsic routines are included. One remark: use
MSVC++ 6.0 only to recompile (since Watcom and Mingw did not succeed).
|
Source text: .cpp (MS Visual C++ 6.0 only)
|
Output language: .asm (16-bit => Tasm, Masm => mz
.exe)
|
Documentation: in English
|
cc68iii3.zip
(~149kb) 68000 and i386 C Compiler v3.1 (c) by Christoph van Wuellen
|
As
the name say, this compiler produces asm listings for Motorola 68000 and Intel
386 (32-bit code) processors. No compiled .exe.
It seems that this stuff is written for SunOS. But Im not completely sure. If
someone figure out, let me know!
|
Source text: .c (ANSI C)
|
Output
language: .asm (GNU GAS assembler) ???
|
Documentation:
in English
|
draak5.zip (~71kb)
Draak the 16-bit multi-language compiler (c) 2000 by Jon Gentle
|
Its
a multi-language compiler, the input language and code generation of which can
be defined in external .def scripts. The given version is tuned to compile
C-like language. The capabilities are not wide though. This project has been
revived on Sourceforge.net. The last version 0.82 is pretty more handy, the
full description is lacking though.
|
Source
text: .pas (Free Pascal)
|
Output
Language: .asm (16-bit => Nasm => mz .exe)
|
Documentation:
in English
|
Home
page: http://draak.sourceforge.net/
|
lcc35.zip (~1.35Mb) LCC
Compiler v3.5 (c) 1991-1995 by AT&T, Christopher W. Fraser and David R.
Hanson
|
It is
an ANSI C compiler, described in A
Retargetable C Compiler: Design and Implementation (Benjamin/Cummings,
1995, ISBN 0-8053-1670-1). Its intended to run under Unix or Win32 and can
generate an asm listing for MIPS, SPARC and Intel 386 (AT&T or Intel
syntax).
|
Source
text: .c (GNU C, Borland C)
|
Output
language: .asm (32-bit => Masm => ??? .exe)
|
Documentation:
in English
|
sc88.zip (~74kb) Byte
Small C V1.0 (c) 1986 by Rick Grehan
|
An
integer C subset.
|
Source
text: .c (ANSI C) compiles itself?...
|
Output
language: .asm (16 bit => Tasm => .com)
|
Documentation:
in English
|
scc.zip (~86kb) Scc c
Compiler v1.0 beta (c) 2001 Rodney McConnell
|
A
little experimental compiler though undone. The outputted asm text is for Sasm
which could be taken from the authors page.
|
Source text: .c (GNU C)
|
Output
language: .asm (32-bit => Sasm => DJGPP .exe)
|
Home
page: http://www.geocities.com/snakessoft/
|
Documentation:
in English
|
sdl31.zip (~345kb)
SDL Compiler v3.1 (c) 2000 by Artyom Samoylenko
|
Its
a C clone. Uses the part of Borland C libraries.
|
Source
text: .cpp (Borland C++)
|
Output
language: .asm (16-bit => Tasm => mz .exe)
|
Documentation:
in Russian
|
slc004.zip (~51kb)
Simple Little Compiler v0.04 (c) 1999-2000 by Rowan Crowe
|
The
cross between C and Basic. In opposite of the previous work of this author,
this one tries to evaluate expression mathematically. Not so fine as could be.
|
Source
text: .moo (MoonRock Basic Compiler, look above)
|
Output
language: .asm (16 bit => Tasm, Masm => .com)
|
Home
page: http://www.rowan.sensation.net.au/slc.html
|
Documentation:
in English
|
smallc22.zip
(~133kb) Small C Compiler v2.2 (c) 1989 by James Hendrix
|
Another
cute and tiny C compiler.
|
Source
text: .c (compiles itself!)
|
Output
language: .asm (16 bit => Tasm, Masm => .com, mz .exe)
|
Documentation:
in English
|
C--
|
32cmm.zip
(~82kb) Sphinx C-- Clone for Win32 (c) 2000 by A. Halimovsky
|
Source text: .c-- (Sphinx Cv0.238)
|
Output format: pe .exe
|
Documentation: in Russian
|
cmmfinal.zip (~655kb)
Sphinx C-- v2.0 (c) 1994, 1995 by Peter Cellik
|
When
Peter Cellik had retired, hed presented to public the sources of his
unforgettable creation Sphinx C--. This is the version 2.0, the last, as
Peter (and many of us) thought. Yeah, piece of cake. This project was
resurrected by Michael Shecker (dont let this name confuse you, hes Russian!)
Wanna see how far hed pulled it? Take this outdated stuff then go there: http://c--sphinx.narod.ru and compare. The compiler is written in C, for
successful recompilation youll need Microsoft C v6.0. The sources of the
Workbench are also included (.pas for Borland Pascal). For those who doesnt
know one particularity, I remind: Sphinx evaluates all expressions left to
right, regardless of operation precedence.
|
Source
text: .c (Microsoft C 6.0)
|
Output
format: .com, .obj
|
Documentation:
in English
|
Context
|
context.zip (~82kb)
Context v1.0 (c) 1995-2002 by Andrey Khokhlov
|
The compiler
as it was thought to be in Wirth times tiny, clear, able to compile itself.
Pity that the worshippers of this idea are almost gone... The Context
programming language looks quite like Modula with some C elements. A little
assembler (written in Context) is included. The emitted code is not optimized
but so did the early versions of Turbo Pascal! The newer version with some
samples: samples.zip (~57kb)
|
Source
text: .ctx (compiles itself!)
|
Output
language: .asm (16 bit => asm8086 => .com)
|
Home
page: http://www.avhohlov.narod.ru/
|
Documentation:
in Russian
|
ctx386w.zip
(~54.7kb) Context for Windows v2.0 (c) 1995-2003 by Andrey Khokhlov
|
The
version of Context rewritten from scratch for Win32 platform. The method of
compilation used here is different from those of its Dos predecessor.
|
Source
text: .ctx (compiles itself)
|
Output
language: .asm (32 bit => Tasm => pe .exe)
|
Home
page: http://www.avhohlov.narod.ru/
|
Documentation:
none, few comments in Russian
|
Pascal
|
cabezon.zip
(~184kb) Cabezon Pascal Compiler v0.08 (C) 1990, 1993 Hiroshi Tokumaru / Ockeghem
|
This
archive was downloaded from some Japanese site via the French link. Cabezon
must be quite compatible with Borland Pascal, as can be said while viewing the
given examples. All the info is in Japanese and you wont be even allowed to
see the hieroglyphs, you shall see some two-byte stuff like Unicode :-)
Libraries sources are also included.
|
Source
text: .pas (Borland Pascal, possibly...)
|
Output
language: .asm (16 bit => Tasm, Masm => mz .exe)
|
Home page: http://www.tokumaru.org/plang/cabezon/cabezon.htm
|
Documentation:
in Japanese 8-/
|
comp.zip (~27kb)
Mini-Pascal 8086 primitive compiler (c) 1997 by Rolland Roessler
|
A
tiny Pascal-subset compiler. This one tries to optimize expressions but not
very successful. Tuned a little by me to be compiled with Free Pascal. Doesnt
have procedures/functions so its not completely usable.
|
Source
text: .pas (Borland Pascal, Free Pascal).
|
Output
language: .asm (16 bit => Tasm, Masm => mz .exe, .com)
|
Documentation:
none, comments in German
|
ip015.zip (~400kb)
Inno Pascal v0.1.5 (c) 2000 by Jordan Russell
|
Its
a Pascal compiler integrated with IDE and debugger. Generated executables (very
small!) will need ipsupport.dll, which is included (but with no sources). The
output code is not optimized though.
|
Source
text: .pas (Delphi)
|
Output
format: pe .exe
|
Home
page: http://other.jrsoftware.org/ip/
|
Documentation:
in English
|
ml307.zip (~108kb)
Milan Compiler (c) 2002 by Serghey Gotsulyak
|
This
tiny Pascal-like compiler is made as the university project on the course The
principles of compiler construction. An archive contains small IDE.
|
Source
text: .c (Borland C)
|
Output
format: .com
|
Home
page: http://www.sergo.pisem.net
|
Documentation:
in Russian
|
p32_04d.zip (~830kb) P32, 32bit Pascal Compiler
v0.4d (c) 1996-1998 Johan Prins
|
p32_05b2.zip (~572kb) P32, 32bit Pascal
Compiler v0.5beta2 (c) 1996-1999 Johan Prins
|
Another
try to write a 32-bit Pascal, greatly worthy of attention. Some of the
advantages: support of floating-point math, compatibility with Borland Pascal
both in syntax and runtime library, code optimization for Pentium processors,
ability to create Dos32, Wdosx and Win32 executables. Disadvantage: this
project was dropped for some reason a couple of years ago. An IDE, brief doc
and some samples are included.
|
Source
text: .pas (Borland Pascal)
|
Output
language: .asm (32-bit => Nasm, Tasm, Pass32 => Dos32 .exe, Wdosx .exe,
pe .exe)
|
Documentation: in English
|
pp002.zip (~44kb) Power
Pascal v0.002 (c) 1993 by Mike Warot
|
Its a very old OS2-oriented Pascal compiler.
|
Source: .pas (Borland Pascal)
|
Output: .asm (32-bit => Masm 6.0 + Link386 = > lx
.exe)
|
Documentation: comments in English
|
pl0c.zip (~359kb) PL/0
Compiler (c) 1998 by H. Weber
|
Its
a language similar to Pascal. The compilation process is divided to several
steps: scanner, parser to pseudo-code, asm generator.
|
Source
text: .c (Borland C 3.1 - 4.5, GNU C 2.7.1)
|
Output
language: .asm (16 bit => Tasm => mz .exe)
|
Documentation:
few comments in English
|
s100.zip (~303kb) S
Compiler (c) by Henry Lesourd
|
This
compiler accepts mixed (Pascal-Basic) language but produces its own executables
(the mixture of bytecode and i386 instructions). Nevertheless, its able to
create .com files.
|
Source
text: .pas (Borland Pascal)
|
Output
format: .pak, .com
|
Documentation:
few comments in English
|
sospasc.zip (~16kb)
Pascal-clone based on PascalPro and P4
|
Not compiled.
|
Source
text: .pas (Borland Pascal)
|
Output
language: .asm (Nasm???)
|
Documentation:
none
|
tp3.zip (~193kb) Turbo
Pascal v3.01A IDE + built-in compiler (c) 1983-1985 by Borland International
|
In
reality, its a disassembled text stored in a very strange format. To gain its
readable view just follow the instructions in readme file. But beware, the
resulting asm text wont be compatible with modern assemblers! Use the ancient
as.com included to this archive to recompile successfully. The detailed
description of compiler internals is included.
|
Source text: .asm (AS)
|
Output
format: .com
|
Documentation:
in English
|
tpascal.zip (~290kb)
Turbo Pascal v6.0 IDE + built-in compiler (c) 1993-1994 by Borland
International
|
I dont remember where Ive got this
stuff from, but these are the sources of Borland Pascal! Not all, actually, but
IDE and built-in compiler only. For recompilation youll need tpc.exe version
six, all standard .tpu modules, tasm.exe (its better not to take version 4.1,
cause its buggy!) and make.exe from the Tasm package.
|
Source
text: .pas, .asm
|
Output
format: mz .exe
|
Documentation:
none
|
wpas.zip (~97kb)
WinPascal 0.001b (c) 1999 by Colin Laplace
|
Its a very primitive compiler for Win32.
|
Source: .pas (Borland Pascal)
|
Output: .asm (32-bit => Pass32 => pe .exe)
|
Documentation: comments in English
|
"Student" compilers are grouped together, cause they have been created as
a part of university studies and the aim of their authors was to pass the test
successfully, but not to create an effective compiler. As a result, even an
elementary optimization was thrown off. There can be exceptions though. Nearly
all files listed below are taken from http://yallie.narod.ru Almost all of these implement a Pascal-clone
language.
|
compi.zip (~22kb)
Language: Pascal clone
|
Author:
unknown
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com
|
Documentation:
few comments in Russian
|
compiler.zip
(~103kb) Language: Pascal subset. As it was done according to lectures but not
the rationality, the result is horrible. The optimization is far away.
|
Authors:
Alexey Popov, Maxim Lobenko, Inna Sedykh
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com + detailed listing of algorithm
|
Documentation:
in Russian
|
compplus.zip
(54kb) Language: strange Pascal clone
|
Author:
unknown
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com
|
Documentation:
few comments in Russian
|
gray.zip (~86kb) Language:
Pascal subset
|
Author:
Serghey Rakhno
|
Source
text: .pas (Borland Pascal, Free Pascal)
|
Output
language: .asm (16 bit => Tasm => mz .exe)
|
Documentation:
few comments in Russian
|
idcomp.zip (~56kb)
Language: Pascal clone
|
Author:
Igor Duyunov (read like this: eager do you know :-)
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com
|
Documentation:
few comments in Russian
|
igr.zip (~62kb)
Language: Pascal clone
|
Author:
Igor Semerenko
|
Source
text: .pas (Borland Pascal)
|
Output
format: mz .exe
|
Documentation:
in Russian
|
lena.zip (~22kb)
Language: Pascal clone (updated version of Igor Duyunovs work)
|
Author:
unknown
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com
|
Documentation:
few comments in Russian
|
liz1998.zip (~56kb)
Language: russified clone of Pascal
|
Author:
unknown
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com
|
Documentation:
in Russian
|
mypas.zip
(~90kb) Language: Pascal clone
|
Author: Alexey Dribnokhod o Yevgheny Agheyev
|
Source
text:: .pas (Borland Pascal)
|
Output format: .com
|
Documentation: in Russian
|
oleg67.zip (280kb)
Language: Pascal subset
|
Author:
Oleg Melnikov
|
Source
text: .pas (Borland Pascal)
|
Output
language: .asm (16-bit => Masm => mz .exe, .com)
|
Documentation:
in Russian
|
pll10.zip (31kb)
Language: ProLogic Local (resembles Pascal a little)
|
Author:
V. Y. Panirovsky
|
Source
text: .c (Borland C)
|
Output
format: .com
|
Documentation:
in Russian
|
slang07.zip (~82kb)
Language: resembles Pascal and Eiffel
|
Author:
Matvey Ralchik
|
Source
text: .pas (Borland Pascal)
|
Output
language: .asm (16-bit => Masm => mz .exe)
|
Documentation:
in Russian
|
Other
|
d2x86.zip (~96kb) D2
Compiler (c) 2002 by Yevgheny Sazonov
|
This language
(resembling Pascal) is strange a little, cause the type of variables cant be
defined!
|
Source
text: .pas (Borland Pascal)
|
Output
format: .com
|
Home
page: http://d2lang.by.ru/
|
Documentation:
in Russian
|
t3x5c.zip (~560kb)
T3X Procedural language (c) 1996-2000 by Nils M. Holm
|
This
language resembles Pascal and BCPL, but the variable type defining is off. (Forth?)
|
Source text: .c (GNU C)
|
Output format: mz .exe
|
Home page: http://www.t3x.org/
|
Documentation: in English
|