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

Spagetti code #46

Open
ercanersoy opened this issue Jun 28, 2018 · 2 comments
Open

Spagetti code #46

ercanersoy opened this issue Jun 28, 2018 · 2 comments

Comments

@ercanersoy
Copy link

I examined TinyBasicPlus.ino file. But, I saw much goto statements.

May functions be applied in this file instead of goto statements?

@hamsternz
Copy link
Collaborator

Hi! This is a topic worth of discussion - I would really like to hear from others who are more active in this project.

This started out as a re-implementation of TinyBasic, which was aimed at very, very limited memory environments (e.g. 1k or less of RAM).

Because of this, avoiding using the stack was a very high priority. I tried to get away with as few bytes as possible, making it authentic to the feel of the original 68k ASM source, and leaving as much memory as possible for user code.

I haven't been following development lately, but I suspect things have moved along a lot since then. and the target environment is no longer targeted to just the smallest of microcontrollers. I am not sure that anybody is counting bytes on he stack any longer.

Should you wish to use functions instead, feel free to make a fork and do so, but do not be surprised if any request to merge back into the main project rejected unless you can convince the current maintainers that the additional memory used for stack space, (and that of any local variables you might declare in those functions) is worthy of the reduction in BASIC program space for memory constrained devices.

Perhaps using some inline functions could be an attractive halfway point?

@BleuLlama
Copy link
Owner

I'd be willing to review an update like that if you wanted it to be mainline TBP... or if you want to make a new project, or whatever, that's cool. :) (or i can add you to this one, and we can make a new mainline fork... I honestly haven't done much TBP dev work in a while, and suddenly picked back up into it this past week for some reason. heh.

So yeah, I was trying to make it useful on the '168 micros, but you had less than 100 bytes for your program. 328p gave you a more usable amount of space. I would thinking making the program space and command line memory relocatable would be the most advantageous... then you could use I2C or SPI RAM/Flash for programs, vastly improving your program sizes. ;) but i'm babbling now..

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

No branches or pull requests

3 participants