For those who don't know, Brainf**k is a minimalist programming language with 8 instructions, with no operands.
http://en.wikipedia.org/wiki/Brainfuck
Someone somewhere wrote a Brainf**k interpreter where you could define your own macros, to make programming easier.
And so I thought, why not use the incredible parsing power of MASM macros?
This is only a basic implementation of the instructions; in the next release I will include some macros. I eventually hope to turn it into a C-style compiler, built on top of Brainf**k.
There are two files: bf.asm contains the basic macros to "assemble" Brainf**k, and test.asm is a sample program that counts from 0 to 9 and then beeps.
Concerning this amazing language, which can of syntax is that? :green
Might I ask you what the hell actually inspired to do anything brainfuck related?
Boredom. I thought it might be interesting, tried it out, then gave up.
Sounds cool
Have you written, anything in MASM?
Cheer Adam
Is the BF language strong enough to allow the creation of a self-replicating program?
You know, like:
c:>type self-rep.source
abcdefxydebc
; then assemble and link to create an exe
c:>self-rep.exe
abcdefxydebc
Sounds like it might be ideal for that!
Yes, it is possible; such a program is called a "quine"
Here's a link to self-replicating C quines (http://sreeram.org/programming/selfreplicating.php#small)! The smallest one is really sweet:
main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
I managed to write one once but mine was more like the 80-line variety with a ton of constant data to do the trick. I'd guess that a BF quine could be a lot short than the C source above!
But BF can't write to files.
I believe that a quine need only output its source code to standard out or something similar. Following a link from the page posted by Phil there are examples in many other languages, including BBF.
http://www.nyx.net/~gthompso/quine.htm