Giter Site home page Giter Site logo

hack's Introduction

Hack Assembly Compiler

Requirements

Compilation requires the Boost v1.5.7 libraries to be installed. As 1.5.7 is the latest version, these can be obtained by using a package manager on UNIX environments.

On OSX (using homebrew): brew install boost

On Linux (using apt): sudo apt-get install libboost-all-dev

Building

The project comes with a working CMake file. To compile on a UNIX environment, use you can simply use make from the main directory.

If that fails, or you need to compile on a different platform, then you can use the provided CMakeLists.txt file to generate build files.

Performance

Local testing shows that files of the maximum possible size for the HACK computer assemble correctly in ~0.1s

The largest optimization that was done was to cache instructions and their comipled form internally. In practise, this resulted in a ~33% speedup (0.15s -> 0.1s) in the worst case.

Other techniques, such as pre-calculating the result for every possible HACK assembly instruction were found to be less effective.

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.