BF+++ code release and spec.
Wednesday 12 May 2010 at 10:33 pm It's up in SVN now: bfint.pyKnown bugs:
Only one TCP socket can be open, and they are all treated the same
Parsing will return uncaught errors if invalid code is used
Memory space is still fixed...
File handles are not implemented well yet
... and many others.
I'll post example code soon with comments.
This file is accessible as spec.rtf.
-------------------------------
+ add to current cell
+(n) add n to current cell
+(*n) add value of cell n
+(&n) add value of cell relative n
+(s) add value of cell named s
- subtract from current cell
-(n) subtract n from current cell
-(*n) subtract value of cell n
-(&n) subtract value of cell relative n
-(s) subtract value of cell named s
< go left one cell
<(n) go left n cells
<(*n) go left value of cell n
<(s) go left value of cell named s
> go right one cell
>(n) go right n cells
>(*n) go right value of cell n
>(s) go right value of cell named s
^ go to cell of current address
^(n) go to cell n
^(*n) go to value of cell n
^(s) go to cell named s
v(*n) copy current mem address into cell
v(s) name current cell
c set current cell to 0
c(n) set current cell to n
c(*n) set cell n to 0
c(s) write string to cell (not cell name!)
[ jump past ] if the value under the current cell is 0
] jump back to ] if the current cell value is nonzero
. output current cell under pointer
.(*n) output current cell to file handle in cell n
! output current cell as number
!(n) output current cell as number
, read in current cell to pointer
,(*n) read in from file handle in cell n
'(*n) open file handle at string starting at s
"(*n) open file handle to hostname and port in string at n
{ define procedure numbered with current cell value
} return to program
: jump to procedure numbered in current cell
:(s) jump to procedure numbered in named cell
j jump to pointer in current cell
j(n) jump n instructions
@ exit with current cell as exit value