Oberon-0
Port of Niklaus Wirth's Oberon-0 compiler to Oxford Oberon-2
- Quiet · last change 7-22-2016
- ★ 2 on GitHub
README
Purpose
This is an exercise in porting an excellent if obscure teaching tool to run on modern systems.
Oberon
The programming language Oberon was conceived by Niklaus Wirth in 1986 as a refinement of his previous languages Pascal and Modula-2. It formed the basis of a complete computer and operating system, a number of which were networked and used at the ETH Zurich for many years.
The language itself is a study in refined minimalism, a strong but bare skeleton that still has a lot to teach modern language designers. In fact, it had a significant impact on the design of Google's Go programming language (http://golang.org))
Oberon-0
Oberon-0 is a subset of the language intended for teaching and introduced in Nikluas Wirth's Compiler Construction (http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf)) This is written in full-fat Oberon to run on the ETH Zurich Oberon System. Not many of these exist in the wild today, but there is a port of the language (without the operating system) still being maintained at Oxford University: the Oxford Oberon-2 compiler http://spivey.oriel.ox.ac.uk/corner/Installing_OBC_release_2.9
Files
This is a port of the original Oberon System source text of the compiler to Oxford Oberon-2, with any necessary changes made to get it to run. The original modules in the book were:
- OSS.m : The scanner
- OSP.m : The parser
- OSG.m : The code generator
- RISC.m : Emulator for target CPU
Only RISC.m is not included. The compiler will instead output an assembler listing. Note! Alpha code, expect bugs.
Running the project (Windows)
First install Oxford Oberon-2 v2.9.7. Next make sure you have the Oxford compiler install directory in your system PATH, so that typing 'obc' in any directory will run the compiler.
Build the project using the included quick lash-up "make.bat". Note: the source files all have a *.pas extension, this is to enable Pascal syntax highlighting in the text editor, but the compiler only accepts *.m extensions.
When built, it will start the Oxford Oberon debugger, necessary because without it, the virtual machine will crash with "Fatal error: fixr LOADQ". Push the RUN button and the Oberon-0 compiler will run, displaying the output to screen and to a file with the same name as the input file
To change the input file, edit make.bat.

