Coder Social home page Coder Social logo

neuroradiology / oberonc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rcorcs/oberonc

0.0 3.0 0.0 2.47 MB

Oberon-0 Compiler: An educational compiler for a subset of the Oberon programming language

License: GNU General Public License v3.0

Batchfile 0.38% Shell 0.11% CSS 0.13% JavaScript 0.65% C++ 90.29% C 1.71% Yacc 5.57% Lex 1.16%

oberonc's Introduction

Oberon-0 Compiler

An educational compiler for a subset of Oberon version 1.0

Suported Architectures
  • Intel x86
  • Intel x86-64
  • MIPS

Quickstart

Windows

oberonc.exe is the compiler executable. It generates an assembly file compiled from the source code.

After oberonc has generated the assembly file, you execute the GNU Assembler (GAS, as) to generate the object file and then execute the GNU Linker ( ld ) to create the executable file of your program.

Files: bin/oberonc.exe bin/gas/as.exe bin/gas/ld.exe

The batches intend to simplify these steps.

Once you've created the assembly file, you can just execute the assemble.cmd and type the name of the assembly file, without the extension (.s) .

The build.cmd do all the steps. It means that you can just execute the build.cmd and type the name of the source file, without the extension (.obe), and it will call the compiler, the assembler and the linker.

Linux

oberonc is the compiler executable. It generates an assembly file compiled from the source code.

After oberonc has generated the assembly file, you can execute the GNU C Compiler (gcc) to generate the executable file of your program.

The build.sh do all the steps. It means that you can just execute the bash.sh passing the path of your source file as an argument, then it will call the Oberon-0 compiler and the GNU C Compiler (gcc) generating the executable in the same folder of you source file.

MIPS (simulator)

The MIPS code generation has been tested using the spim (MIPS simulator). In order to compile for MIPS architecture, make use of the -mips option, e.g. oberonc file.OBE -mips, then the compiler will generate a file.s output file with the assembly code for the MIPS architecture. Afterwards, you can run the spim simulator with the assembly file.

TODO

Finish support to x64 architecture.

Code optimisation.

Building Dependencies

oberonc's People

Contributors

rcorcs avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.