Description
Right now, Brainduino does not keep the current index
information and always start at cell 0
. However, this behaviour will need to be changed once the Arduino does not have enough space for the whole source code. My idea is to allow Brain to run the code partially (not the code, but just some chunks of it). Loops may suffer with this new style, however we will need to do it in order to run larger programs.
Another solution is to use the Flash Memory
with the macro F()
, but we will still fail on big programs.
Consider the following code:
>>>>>>>?:++;>?<<<<<:++++++++>+*>+*>+++++++*<--*<---*<<<<<<;
?->>>>>>^>>>+<<<<^:<<;?->>>>>>>>^>>>-<<<<^;>>>>>>>>^?:++;<<?:++++++;>>>+%
<<?:+;^>>>>>>>>>^?:++;>+%++>?--:++>_%<++++++++++++;?:>?<<<<<<<<?<<<<<^
?:+;;:<<<<<<<<?:<<<<<^?:+;;;;
Even though simple, that occupies more than 200 bytes in memory (that is, 10% of the Arduino Uno storage) and this is for our simplest game.
If we had one buffer sized 100 bytes, we could divide the code above in three parts and just after that run the PPU! :)
Therefore, we would only use 5% of the Arduino storage and we would the possibility of running pretty much anything!!!!