ExBF

Extended Brain Func is Brainfuck extended :)
From the original author of Brainfuck language:
"   
THE LANGUAGE
============

The language 'brainfuck' knows the following commands:

Cmd  Effect                                 Equivalent in C
---  ------                                 ---------------
+    Increases element under pointer        array[p]++;
-    Decrases element under pointer         array[p]--;
>    Increases pointer                      p++;
<    Decreases pointer                      p--;
[    Starts loop, counter under pointer     while(array[p]) {
]    Indicates end of loop                  }
.    Outputs ASCII code under pointer       putchar(array[p]);
,    Reads char and stores ASCII under ptr  array[p]=getchar();
  "
 -Urban Mueller     


The BF is a ´turing complete machine´ without functions or calls.
This exBF implementation extends the internal operations to make possible the use of functions and calls.
The Extended Brain Func interpreter have the follow changes:
The model machine of exBF is like a four tape machine, each for read the program, read/write the data, read a byte file and write a byte file;
Each finite tape have LIMITED cells, defined at compile time;
Each cell are unsigned char ( one byte );
All operations on tape, are backward or forward steps;
All operations are done with two pointers and two counters;
THE EXTENDED BRAIN FUNC LANGUAGE (exbf)
================================

Syntax:

Cmd  Effect                                 Equivalent in C
---  ------                                 ---------------
+    Increases cell under pointer           (*dp)++;

-    Decreases cell under pointer           (*dp)--;

>    Increases pointer                      dp++;

<    Decreases pointer                      dp--;

-----modifed

[    Starts a forward loop,           
     if cell under pointer is 0,   
     seek forward to nested ]
     else exec next cells                   while( *dp ) { }
     
]    Starts a backward loop,            
     if cell under pointer is not 0,   
     seek backward to nested [
     else exec next cells                   do { } while( *dp )
     
.    Outputs byte code under pointer        write (1,dp,1);

,    Reads byte and stores under ptr        read  (0,dp,1);

-----extensions 

:    Skips forward until reach a nested ;  * like C slash star start comment
     (borrow from forth)

;    Skips forward to next position        * like C star slash stop  comment
     (borrow from forth)

(    Mark position to go                   * mark nth '(' --- NOT C

)    Skips backward to the nth '='	   * goto nth '=' --- NOT C

=    Skips forward to the nth '('          * goto nth '(' --- NOT C

\0   end of tape                           * end program  --- NOT C
 
&    reserved symbol for future use 

@    reserved symbol for future use

All other symbols are dummy.



Notes:
1. the pairs operators [] :; () can be nested
2. all cells are ONE byte, so BF programs that requires signed integers DONT work.
3. a function seems: :( internal code ); // on return the function must leave at *dp the same value as on call
4. a call to function seems: [-]++++++= // call the 6th function backwards
5. the biologic RNA is so simple as BFE ?

How to compile?
using gnu libc: gcc -O2 exbf.c -o exbf
or using dietlibc: diet gcc -O2 exbf.c -o exbf

Li(nux)sense ? Copyright (c) 2003 Alvaro Gomes Sobral Barcellos All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


SourceForge.net Logo

Sorry, no more information here for now.

go to exbf.sourceforge.net

go to goggle and search for 'brain fuck'