Code Monkey home page Code Monkey logo

bf's Introduction

bf

a simple brainfuck interpreter

Note

This is a project I made in an afternoon, while at home with a fever.
If you any see obvious bugs, now you know why.

bf is a simple brainfuck interpreter that can read a program from either stdin or a file. It supports programs up to 32KB in size.

The source code comes in two languages:

  • C: this is the first version I made and it was a prototype for the second one
  • x86-64 assembly: this is the second version, and it limits itself to using only the original x86 registers (*ax, *bx, *cx, *dx, *di, *si), which should make it easier to port to 32-bit, if I ever want to :^)

usage

$ bf [INPUT-FILE]

where INPUT-FILE is an optional arguments, and is a valid path to a file containing a valid brainfuck program. If no argument is provided or if INPUT-FILE is -, bf will read the program from standard input.

Note

The program must under 32KB in size.

building

To build the C version run:

$ make c

To build the x86-64 assembly version run:

$ make asm

Warning

Both build targets will produce an executable called bf and will overwrite any existing file with that name in the same directory as the makefile.

bf's People

Contributors

markx86 avatar

Watchers

 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.