You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 years ago | |
---|---|---|
examples | 3 years ago | |
src | 2 years ago | |
.gitignore | 2 years ago | |
BuildUNIX.sh | 3 years ago | |
BuildWindows.bat | 3 years ago | |
CMakeLists.txt | 2 years ago | |
LICENCE | 2 years ago | |
README.md | 2 years ago |
README.md
OBFI
OBFI is a minimal and performant Brainfuck interpreter.
Implementation Details
- OBFI uses single octet cells, and arithmetic wraps around.
- OBFI provides 30000 cells.
- OBFI does not perform array bound checking.
- OBFI will set the current cell to 0 when EOF is encountered.
Optimisations
- Compress
>
and<
instructions. - Compress
+
and-
instructions. - Replace
[+]
and[-]
with a 'set to zero' instruction. - Replace
[>]
and[<]
with a 'go to zero' instruction. - Replace
[+>+>]
and[>+>+]
with a 'move to' instruction. - Replace
[-<-<]
and[<-<-]
with a 'move to' instruction.
Usage
Dependencies
- CMake >= 3.12, to build
Building
To build OBFI on UNIX, run BuildUNIX.sh
.
- Binaries will be located in the
bin
directory.
Meta
Copyright (C) 2020, Jakob Wakeling
MIT Licence