Page 1 of 1

brainfuck interpreter

Posted: Mon Dec 31, 2007 10:22 am
by matias_beretta
hello, thanks for reading my topic. i am writing a brainfuck interpreter for my os. Actually it is very easy but i'm having problems with loops:

[ Jump forward past the matching ] if the byte at the pointer is zero.
] Jump backward to the matching [ unless the byte at the pointer is zero.

Do you have any idea about how can i code those instructions?

thanks

Posted: Mon Dec 31, 2007 11:02 am
by Craze Frog
It depends on how the rest of the interpreter works.

Posted: Mon Dec 31, 2007 11:25 am
by Dex
You can take a look at DexOS's brainfuck interpeter, if you want.

reply

Posted: Mon Dec 31, 2007 11:34 am
by matias_beretta
ok thanks... where can i see dexos' brainfuck source code?

Posted: Mon Dec 31, 2007 11:37 am
by lukem95
he attached it to his post

lol

Posted: Mon Dec 31, 2007 11:39 am
by matias_beretta
for any reason Firefox didn't show it me the first time i visited the topic. thanks..

answer

Posted: Mon Dec 31, 2007 12:15 pm
by matias_beretta
dex, is it possible to put a loop into another loop in your interpreter?

Posted: Mon Dec 31, 2007 1:24 pm
by Dex
I did not code it, it was a member of Team DexOS called Solidus117.
But depending where in the loop and as long as it does not slow it, or change a needed reg etc.
You should be OK, but if in doubt, try it.

Posted: Sat Feb 02, 2008 8:27 am
by Solidus117
Who... what?