Skip to content

Releases: nthnn/brainfuck-assembly

Brainfuck Assembly v1.0

24 Aug 18:04
Compare
Choose a tag to compare

Build CI License: MIT

Brainfuck Assembly (BFASM) is a human-readable assembly language designed to simplify the process of writing Brainfuck programs. Brainfuck, a minimalist esoteric language, uses only eight commands and is notoriously difficult to write and maintain due to its cryptic syntax. Brainfuck Assembly serves as an intermediate language, allowing developers to write more understandable code, which can then be translated into Brainfuck.

Example

This example implements a simple echo program that reads input from the user and outputs it, effectively functioning as a basic "cat" command in Unix, which outputs its input to the standard output.

in          ; Get an initial input
jmp begin   ; Begin the loop
    out     ; Output the previous value
    in      ; Get another input
jmp end     ; End of loop

Simply transpile the cat.bfasm example program if the Brainfuck Assembly is already installed on the current system with the following command:

bfasm examples/cat.bfasm dist/cat.bf