brainfuck interpreter

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

brainfuck interpreter

Post 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
Matías Beretta
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Post by Craze Frog »

It depends on how the rest of the interpreter works.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

You can take a look at DexOS's brainfuck interpeter, if you want.
Attachments
BFI v1.0.zip
(54.66 KiB) Downloaded 103 times
Last edited by Dex on Mon Dec 31, 2007 11:37 am, edited 1 time in total.
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

reply

Post by matias_beretta »

ok thanks... where can i see dexos' brainfuck source code?
Matías Beretta
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post by lukem95 »

he attached it to his post
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

lol

Post by matias_beretta »

for any reason Firefox didn't show it me the first time i visited the topic. thanks..
Matías Beretta
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

answer

Post by matias_beretta »

dex, is it possible to put a loop into another loop in your interpreter?
Matías Beretta
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
Solidus117
Posts: 23
Joined: Sun Dec 03, 2006 5:29 pm

Post by Solidus117 »

Who... what?
Post Reply