Skip to content

Brainfuck language interpreter and translator to DOS MASM assembler.

License

Notifications You must be signed in to change notification settings

InAnYan/bf-translator

Repository files navigation

Description

bf-translator - Brainfuck language interpreter and translator to DOS MASM assembler.
Generates .ASM files, needs to be compiled by MASM.
Tested on programs from http://brainfuck.org/ with MASM 6.11 in DOSBox.
WIRTTEN FOR EDUCATIONAL PURPOSES.
Stability and correctness are not guaranteed.

Usage

First argument is brainfuck file, second is output .asm file.
If no second argument provided, the brainfuck program is interpreted.

Known issues

  1. When Enter key is pressed on Windows, the terminal sends \n to program, but DOS sends \c. Because many brainfuck programs use \n, you can send it by typing ALT+10(numbers on numpad).
  2. By default many terminals are running in canonical mode, but this translator is using direct key input from DOS (mov ah, 01h, int 21h). This causes not pretty output.