OBFI

Brainfuck Interpreter
git clone http://git.omkov.net/OBFI
Log | Tree | Refs | README | LICENCE | Download

AuthorJakob Wakeling <[email protected]>
Date2020-07-14 01:19:24
Commit44e07d6c967d25f6473f026083580cff382a8b08
Parent1d938fdb1f0f41cbdbccaa53de636f05d8ee46c4

Update README and build script

Diffstat

M README.md | 13 +++++++++++++
M build/buildUNIX.sh | 4 ++--

2 files changed, 15 insertions, 2 deletions

diff --git a/README.md b/README.md
index 0815999..e9554f5 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,21 @@
 
 > OMKOV Brainfuck Interpreter
 
-The OMKOV Brainfuck Interpreter (OBFI) is a simple interpreter for Brainfuck.
+The OMKOV Brainfuck Interpreter (OBFI) is a minimal Brainfuck interpreter.
 
 ## Implementation Details
 
 * OBFI uses single octet cells, and arithmetic wraps around.
 * OBFI provides 30000 cells.
+* OBFI will segfault if a program moves outside the array bounds.
+* OBFI will sets the current cell to -1 when EOF is input.
+
+## Optimisations
+
+* Compress `>` and `<` instructions.
+* Compress `+` and `-` instructions.
+* Replace `[+]` and `[-]` with a 'set to zero' instruction.
+* Replace `[>]` and `[<]` with a 'go to zero' instruction.
 
 ## Build Instructions
 
diff --git a/build/buildUNIX.sh b/build/buildUNIX.sh
index d7d509f..38dd3a2 100755
--- a/build/buildUNIX.sh
+++ b/build/buildUNIX.sh
@@ -1,4 +1,4 @@
 #!/usr/bin/env sh
-dir="$(dirname $(realpath "$0"))"
-cd "$dir" && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ../ && make
+dir="$(dirname $(realpath "$0"))" && cd "$dir"
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ../ && make
 mv -f "compile_commands.json" "../compile_commands.json"