https://github.com/richarddorian/brainfuck-asm
A Brainfuck interpreter written in x64 assembly for Linux
https://github.com/richarddorian/brainfuck-asm
assembly brainfuck brainfuck-interpreter interpreter
Last synced: 12 months ago
JSON representation
A Brainfuck interpreter written in x64 assembly for Linux
- Host: GitHub
- URL: https://github.com/richarddorian/brainfuck-asm
- Owner: RichardDorian
- License: mit
- Created: 2024-03-13T23:43:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-26T22:53:57.000Z (about 1 year ago)
- Last Synced: 2025-06-26T23:56:46.338Z (about 1 year ago)
- Topics: assembly, brainfuck, brainfuck-interpreter, interpreter
- Language: Assembly
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `brainfuck-asm`
A [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) interpreter written in x86_64 assembly for Linux based systems.
> [!IMPORTANT]
> I made this because I was bored at night. I don't guarantee any support of any kind. This project was made thanks to the Almighty Coffee God. Don't ask too many questions about how it really works because it's very likely that I already forgot everything!
## Usage
I have absolutely no idea why would you want to know how to use a Brainfuck interpreter.. Anyways, apparently you do so let's dive in!
For now the program is hardcoded because I really need to get some sleep. I'll do program loading when my brain decides not to be a lazy fu\*\*. Here's how to run it:
```bash
./interpreter
```
## How do I write a Brainfuck program?
Heads up: that's a terrible idea. Here's the [Wikipedia](https://en.wikipedia.org/wiki/Brainfuck) page. There, you can find a simple but useful table which states everything you can do. The language is pretty basic and easy to understand but is a living hell to use.
## Exit codes
It might go wrong. If, somehow, you manage to encounter a handled error the program will exit with a non zero exit code.
If you are lucky, the program will tell you what happened. Most of the time it wont; especially if you catch a never seen before error (_or worse, a segfault_ 😱)
| Exit code | Description |
| --------- | --------------- |
| `0` | No error |
| `1` | Incorrect usage |
## Build
If you want to build this project on your machine, I am so sorry but it's all lost and hopeless for you.. I am not joking, nobody can help you at this point.. Anyways, here's a simple guide:
1. Make sure you are on a Linux distribution (you didn't really expect this to work on Windows, did you??). You can use WSL if you want.
2. Install the `nasm` compiler (should be `apt install nasm` on most distributions and `pacman -S nasm` for the elite).
3. Run the `./compile.sh` script. This will compile the program and create a binary named `interpreter` inside the `build` folder.