KellanClark / armfuck

Turing completeness from two RISC instructions

Home Page:https://kellanclark.github.io/2023/09/18/armfuck/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ARMfuck

ARMfuck shows that ARM's LDM and STM instructions are Turing-complete by using them, and no other instructions, to implement an interpreter for a version of a Brainfuck. For more information on how it works, read this blog post.


Using

This repository comes provided with a compiled ROM that has quine.bf (the program running in the image) loaded. To load a new Brainfuck program or change the input, it must be converted into a form the interpreter can understand and inserted into the ROM by running

python scripts/loadprogram.py <brainfuck file> [input text]

Once you've selected a program, you can run armfuck.gba on a Game Boy Advance emulator of your choice or use a flashcart to run it on a real system.


Compiling

The base ROM can be compiled with the included FASMARM using the command

.\FASMARM\fasmarm.exe header.s armfuck.gba

on Windows or

./FASMARM/fasmarm header.s armfuck.gba

on Linux.

If you intend to run or test on the mGBA emulator, you must add -d MGBA=1 or it won't be detected as a valid ROM.

Changes to certain parts of the header additionally require you to run

python scripts/headercompliment.py armfuck.gba

or modify the header compliment value in header.s.

About

Turing completeness from two RISC instructions

https://kellanclark.github.io/2023/09/18/armfuck/


Languages

Language:Assembly 96.6%Language:PHP 2.1%Language:C++ 0.8%Language:HTML 0.3%Language:Python 0.2%Language:Brainfuck 0.1%Language:NASL 0.0%Language:Batchfile 0.0%