Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of setting the pointer index #5

Open
luizperes opened this issue Oct 17, 2016 · 0 comments
Open

Possibility of setting the pointer index #5

luizperes opened this issue Oct 17, 2016 · 0 comments

Comments

@luizperes
Copy link
Member

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!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants