Nice for avr, cheers.
The "for" help has been updated to mention overflow but now needs a rewrite to show the checking.
I never found a problem with for-next probably cos I made sure the steps were ok and used a var for minus values.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The new FOR-NEXT checks certainly help to avoid program errors. I think this makes sense for a BASIC programming language. Unfortunately this increases the size of my current program by ca. 260 bytes. Bad for me, because the program size is slowly approaching the limit for an Attiny85.
Is there any chance, that these additional checks are inserted only for step sizes other than 1 (or -1)? This way the limits could still be checked where needed and the memory usage for simple loops stays small.
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
See I will post a new exe compiler today that supports enabling the old FORNEXT method. Add the constant to the source and it will revert to the old code. I knew it was a good idea not to delete the original code.
The old method is riddled with bugs and is not advised unless the very simplest of operations are used and the program is fully tested.
So, you will be able to add the following to use the old method.
#define USELEGACYFORNEXT
Last edit: Anobium 2021-03-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Resolves a for-next issue where the for-next failed when all three parameters (not the loop) are defined as Constants and the EndValue is negative.
Add for-next optimisation when all three parameters (not the loop) are defined as Constants and are all positive values. The compiler will use the legacy code automatically.
Resolves a Table Text issue where an incorrectly terminated string silently failed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Again, this release candidate is NOT a normal few tweaks or changes.
This has a major changes
Download Folder
https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/
Please replace RC43 asap.
Nice for avr, cheers.
The "for" help has been updated to mention overflow but now needs a rewrite to show the checking.
I never found a problem with for-next probably cos I made sure the steps were ok and used a var for minus values.
Hi Evan!
The new FOR-NEXT checks certainly help to avoid program errors. I think this makes sense for a BASIC programming language. Unfortunately this increases the size of my current program by ca. 260 bytes. Bad for me, because the program size is slowly approaching the limit for an Attiny85.
Is there any chance, that these additional checks are inserted only for step sizes other than 1 (or -1)? This way the limits could still be checked where needed and the memory usage for simple loops stays small.
Frank
Can I look at the source ?
I would expect a few extra words of progmem but not an increase of 180 words.
I have added more rationalisation today. But, I need code, like yours, to examine the growth.
RC42:
Every FOR-NEXT loop adds 24 bytes of code.
RC44:
First FOR-NEXT adds 50 bytes, every following 40 bytes.
Assuming my program uses 20 FOR-NEXT loops, the difference is 330 bytes.
Great points. Totally understand.
See I will post a new exe compiler today that supports enabling the old FORNEXT method. Add the constant to the source and it will revert to the old code. I knew it was a good idea not to delete the original code.
The old method is riddled with bugs and is not advised unless the very simplest of operations are used and the program is fully tested.
So, you will be able to add the following to use the old method.
#define USELEGACYFORNEXT
Last edit: Anobium 2021-03-24
A few updates to the compiler to fix an issue and provide improved table text support.
Put the file from here https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/Patches/ in your GreatCowBASIC folder.