Tero Koskinen is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

tkoskine / ada-bfc

Brainf*ck compiler written in Ada. Requires ada-ir repository.

Clone this repository (size: 10.3 KB): HTTPS / SSH
hg clone https://bitbucket.org/tkoskine/ada-bfc
hg clone ssh://hg@bitbucket.org/tkoskine/ada-bfc

ada-bfc overview

Recent commits See more »

Author Revision Comments Message Labels Date
Tero Koskinen b9addfc465af Increase memory size to 2k.
Tero Koskinen 7938b726fe50 Tweak formatting.
Tero Koskinen 465362ec40d1 Add a small README.
Tero Koskinen e4a32897c487 Add more examples.
Tero Koskinen 01f9a6fd4d9e Make examples more complex.

Brainfuck compiler for x86 written in Ada

ada-bfc is a Brainfuck compiler for x86 written in Ada. It parses the Brainfuck programs and generates GAS assembly code from them.

The used cell size is one (1) byte and amount of cells configurable by a compile time option.

Building

For building you need ada-ir module from https://bitbucket.org/tkoskine/ada-ir

Steps:

hg clone https://bitbucket.org/tkoskine/ada-bfc
cd ada-bfc
hg clone https://bitbucket.org/tkoskine/ada-ir
mkdir objects
gnatmake -P brainf

Compiling programs

The compiler generates GAS assembly either to a file or to standard output. This assembly you need to compile/link together yourself with gcc.

Example

./main examples/hello.bf hello.s
gcc hello.s -o hello