Code Monkey home page Code Monkey logo

42mips's Introduction

**to use the compiler the backend must be turned into a library by invoking "python buildLib.py", this will generate the 'library' file required by the program**

The program is written in Standard ML, and is intended to be run using the Standard ML of New Jersey, which can be found at https://www.smlnj.org/ . A precompiled version is available in both the Debian and Ubuntu PPAs. To build the program, while in the project directory, run 'sml compiler.cm'. This should bring you into an interactive environment containing the Compiler structure, which is used to process files containing a stack language loosely resembling Forth. (The program should nominally work under Poly/ML, however it currently makes use of CM, which is specific to SMLNJ)

The compiler supports the basic stack language we used in class with the exception of while loops. additionally function definitions are now structured as ":name { def }" where the spaces around the braces are necessary.

compiler.cm provides the actual compilation tools. When built it provides the function "Compiler.write name input lib" where name input and lib are strings which respectivley represent the name of the file you want to output, the file you want to compile, and the name of the library output by buildLib (which should be lib.asm). For example, 'Compiler.write "output" "test.txt" "lib.asm"' should generate the file output.asm, a valid MIPS assembly file.

the output can be run in the MARS emulator

42mips's People

Contributors

ragingsloth avatar

Watchers

James Cloos 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.