Skip to content

A C program that converts BF instructions to x86 assembly and then compiles into an executable using nasm and ld.

License

Notifications You must be signed in to change notification settings

ritlew/bf-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bf-compiler

A compiler written in C that converts bf instructions to x86 assembly and then compiles into an executable using nasm and ld.

The program has 30000 cells, and can only read 30000 total commands (+-.,[]<>) from the file. Cells are 32-bit.

Tested on all programs in examples folder on Ubuntu 16.04 and Fedora 25. It should work on any linux distrobution. Not supported on Windows.

Dependencies

Now using as instead of nasm! The only dependency is gcc.

Compiling

Simply compile the C file with the following command:

gcc -o bfc bfc.c

or

make

Running

Simply compile your program into an executable with the following command (needs .bf extention):

./bfc examples/hello_world.b

Output assembly file:

./bfc -S examples/hello_world.b

Output object file:

./bfc -O examples/hello_world.b

About

A C program that converts BF instructions to x86 assembly and then compiles into an executable using nasm and ld.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published