Brainfuck to nasm compiler
Just clone this repo, and do what you want!
$ git clone https://github.com/m13253/bf2nasm.git
$ make
$ make debug
Remove all the intermediate files (e.g. *.o
, test.asm
and test
)
and bf2nasm
.
$ make clean
bf2nasm
takes stdin as its input, and output the compiled nasm source
code to stdout.
$ # make sure you have already compiled bf2nasm, if not, type:
$ # make
$ # And you can clean up the intermediate files by typing:
$ # make clean
$ ./bf2nasm < input.b > output.asm
Then you will get a well formatted nasm source code. To compile it into an executable file, type:
$ nasm -f elf32 -o output.o output.asm # compile
$ ld -melf_i386 -o output output.o # link
BFIN="input.b"
BFOUT="output"
make
make clean
./bf2nasm < "$BFIN" > "$BFOUT.asm"
nasm -f elf32 -o "$BFOUT.o" "$BFOUT.asm"
ld -melf_i386 -o "$BFOUT" "$BFOUT.o"
Licensed under LGPLv3.
ABSOLUTELY NO WARRANTY!