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
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement