The ld instruction is turing complete by itself (with a single ret). I made a brainf**k -> ld only assembly compiler to prove it.
https://github.com/Dragon-Hatcher/Brainf**k/blob/main/main.asm
(replace the ** with uc. the forum doesn't like the expletive)
(note that I can't guarantee that the , instruction gets any sensible inputs but I did map the prints to ascii so most programs should work)
To run your own programs just replace the code at the bottom after the bf. The currently loaded program prints the Fibonacci numbers.
I didn't come up with this myself. All the ideas came from this talk about an equivalent compiler for x86 mov. https://www.youtube.com/watch?v=R7EEoWg6Ekk
Feel free to ask any questions
https://github.com/Dragon-Hatcher/Brainf**k/blob/main/main.asm
(replace the ** with uc. the forum doesn't like the expletive)
(note that I can't guarantee that the , instruction gets any sensible inputs but I did map the prints to ascii so most programs should work)
To run your own programs just replace the code at the bottom after the bf. The currently loaded program prints the Fibonacci numbers.
I didn't come up with this myself. All the ideas came from this talk about an equivalent compiler for x86 mov. https://www.youtube.com/watch?v=R7EEoWg6Ekk
Feel free to ask any questions