To build all the distributions of Great Cow BASIC, and, now the updates are fully automated here.
R2Build. Software that can execute 100s of steps in sequence, from simple ini file updates to complex database changes.
OS Command files. Using R2Build I have 11 small batch files that do things at the OS level like rename all files to lower case (needed for the Linux build).
I will gladly share the tools I use, and, the processes to help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The update automatically overwrites a lot of the .ini and .bat files that I then have to try and remember which files I need to change back again to return the NSDSP programmer and Geany to working order.
Right now at home I'm using Windows 10 but at work I'm still on my iMac. I don't have any inclination to start on updating the Mac version again. Especially as I no longer have a Mac at home.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you think it has taken so long to find errors in gcb because no one uses the commands.
I would think, as a beginner, that sound would be interesting...but then you got to have a "speaker"...so too much bother.
Can't do much with a ucontroller unless you connect it to something.
GCB does that easyish.
We aren't all pic users. I'm liking logic green technology....the name sounds cool and it's zippy with gcb.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A bit of history. "For next" had issues for a very long time. But these would not show up when stepping with a value of 1, which is the most common usage. However, when stepping with other values (2 for example) the for next loop could become endless as overflows were not being handled correctly in certain cases. This was all fixed in one of the release candidates.
However there was a typo in a section of the new for next code. This typo was responsible for the issue that JackJames had with the Tone code. Under somewhat rare circumstances this typo caused a variable used with for next not to be cast correctly . This problem did not show up under testing before release of the code. It has been fixed now in the latest build.
The latest build is: 0.98.07 2021-07-24 : Build 1008
This should be considered a "Critical Update" and as a minimum going forward. Yes, updating may cause some time and inconvenience. However, without this update the generated ASM is likely to be incorrect and certain programs or libraries may not operate as expected.
If you care to see an example of the original for next issue try this code:
You explain the problem well @William Roth.
Never heard off #Define uselegacyfornext
It's the sort of thing the user would have seen.. ie an overflow.
The fact that gcb didn't do something else when compiling like a check is an obvious oversight but can see now how it got this far without being noticed.
My reference to tone was who uses it?
There's some dma stuff on the forum which looks interesting but probably hard to understand pic stuff.
I got to get into pics more but find it easier to use avr cos they come on boards with lots of pins and the usb which you only get with pic dev boards which cost more.
I hope that avr support.. like the lgt328 is kept up as it's great for a lot of stuff and is now sorted and consistent .
Don't get me wrong. I think the pic stuff is brill.. but sometimes over my head.
The idea of a pic with an op amp built in seems a good idea but in practice I bet it's not trivial to set up. So I'd go for a discrete op amp and a bit of extra circuitry.
Still think gcb is really good software.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So the for next problem is the step... which is sorted.
so for count1=0 to 255 step 3 would work but
for count1=0 to 255 step 6 wouldn't.
edit is that what the problem was and did it apply to word value counters as well?
I wouldn't understand how it was resolved but did it test if the step value /255 or /65535 was an exact number ie no remainder? Just a thought.
Last edit: stan cartwright 2021-07-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The solution was not as simple as shown on the post above but is gave me insight to resolve.
The original code was simple and covered most cases. But, as the URL above discusses the loops are unacceptable. There is a trade off. The legacy code is smaller ( in this example ) using90+ words of program memory to do all the additional checking.
More example code. If you try this on an UNO you will see the issue.. just uncomment #DEFINE USELEGACYFORNEXT to see the continuous loop.
This for next error wouldn't have become apparent without sloppy. deliberate programming.
When you think about it it's obvious it could happen... just one of those things that never happens.
Well it never happened to me.. luck?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thisfornexterrorwouldn't have become apparent without sloppy. deliberate programming.
This is simply not true. And, likely based upon how you personally presume a program should be constructed . A perfectly well constructed program could fail under the right conditions. I provided one example.
A For Next has a start value an end value and a step value. Many times we use constants for these since we know where to start, where to end and what the step value should be. But this is not always the case. If these are variables that could change then the compiler needs to be able to handle these in a proper manner without generating final code that is unpredictable.
I can think of several cases where the original for next could fail without "sloppy programming". Perhaps you should educate yourself a bit more before making such off-hand comments.
I seem to have scuppered a previously working program.
I have a For - Next loop which has a negative step value. The value is passed as a parameter into the subroutine. I'm getting an error which states:
Error:MissingclosingdoublequoteinTablesource:221'" Current/C1_16f1829_3.04.gcb(651):Error:For-Next'step' must beIntegervariable
SubDoCountDownSub(StartAsWord,ReduceAsByte)IfStart>9999ThenLetStart=9999EndIfForLoopCnt=Startto0Step-ReduceShowValuesSub(LoopCnt)...'Rest of loop hereNext
Ignoring the Table error for a second, should I be creating the step variable as a separate byte variable within the subroutine and then setting that variable to the value of my parameter or should I be able to use the byte value parameter directly as I was doing previously?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The variable Reduce needs to an integer as the error states.
'Reduce As Integer' is needed with the FOR-NEXT routines.
If someone can figure out how NOT to have an integer then I would be grateful for the help. But, as you are using a variable the type must be an integer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is something not correct in the compiler. It is probably just an errant message but I will have to investigate to resolve. I did ask people to test the FOR_NEXT changes as these changes were extensive - never enough testing :-(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
{I had some other comments regarding use of constants here. I later removed those comments as it has been suggested that although the program compiled it might not have worked as intended.}
I tried leaving the program as it was, adding the legacy directive:
Answering my own confusion here. The value for the 'Step' must be a fixed constant now. Not a parameter (of any type), not a variable (of any type), a fixed value constant.
You analysis is correct. Using constants is not the resolution. It is a theory but analysis show it is another cause.
The issue is the NEGATing of the value '-Reduce'. This is causing the variable Reduce to be treater as a BYTE. This has nothing to do with the new FOR-NEXT code as the negate happens before the FOR-NEXT section of the compile is called.
ForLoopCnt=Startto0Step-ReduceNext
Proof (I have added debug but this shows this to be the case. This casts '-Reduce' to an integer.
ForLoopCnt=Startto0Step[INTEGER]-ReduceNext
As the negate causes the variable to be a byte the ASM generated contains no step variable decrement step code (just increment step code).
This needs fixing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a lookup table for the alphabet which maps ascii codes to some values which cross reference a first (alphabetic) table into the numeric values needed to show that character on four seven segment LED displays driven by four 74HC595.
221 is a value which lights the top two vertical segments, to give the effect of a double quote. My table is (or was) correct, the quote symbol is 'Rem'ed out by the preceeding single quote.
I can replace the double quote with the phrase 'Double Quotation mark' so it can soon be repaired, though it is a little odd that a remark should be attempted to be compiled?
TableAlphabetAsByte255' Space255'! Space221'" 255'# Space255'$255'% Space255'& Space223' 198'( Square bracket240') Square bracket255'* Space255'+ Space127', Single decimal point191'- Dash in the middle of the display127'. Single decimal point237'/ Two offset vertical bars 'i192'0249'1164'2176'3153'4146'5130'6248'7128'8144'9255': Space255'; Space167'< 'c'183'= Two dashes, one at the bottom, one in the middle179'> 'c' inverted172'?255'@ Space136'A128'B198'C192'D134'E142'F194'G137'H207'I241'J137'K199'L200'M200'N192'O140'P152'Q 'q'206'R146'S135'T193'U193'V 'U'193'W 'U'137'X 'H'145'Y164'Z looks like a 'two'198'( Square bracket219'\ Two offset vertical bars i'240') Square bracket220'^ 'n' in top portion of display247'_ Dash at the bottom of the display253'163'a 'o'131'b167'c161'd134'E142'f144'g139'h239'i241'j139'k207'l171'm171'n163'o140'p152'q175'r146'S135't227'u227'v 'u'227'w 'u'137'x 'H'145'y164'z looks like a 'two'198'{ Square bracket207'l Two vertical bars to the left of the display 240'} Square bracket254'~ Dash at the top of the displayEndTable
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What are the changes you make ?
Remind which OS.
An insight.
To build all the distributions of Great Cow BASIC, and, now the updates are fully automated here.
I will gladly share the tools I use, and, the processes to help.
The update automatically overwrites a lot of the .ini and .bat files that I then have to try and remember which files I need to change back again to return the NSDSP programmer and Geany to working order.
Right now at home I'm using Windows 10 but at work I'm still on my iMac. I don't have any inclination to start on updating the Mac version again. Especially as I no longer have a Mac at home.
Yeah source forge eventually does download gcb but takes ages... never did before.
The download took a few seconds for me?
Do you think it has taken so long to find errors in gcb because no one uses the commands.
I would think, as a beginner, that sound would be interesting...but then you got to have a "speaker"...so too much bother.
Can't do much with a ucontroller unless you connect it to something.
GCB does that easyish.
We aren't all pic users. I'm liking logic green technology....the name sounds cool and it's zippy with gcb.
No. FOR-NEXT is use extensively. The issue was deep in the compiler and we did not pick up on testing earlier this year.
@Stan
A bit of history. "For next" had issues for a very long time. But these would not show up when stepping with a value of 1, which is the most common usage. However, when stepping with other values (2 for example) the for next loop could become endless as overflows were not being handled correctly in certain cases. This was all fixed in one of the release candidates.
However there was a typo in a section of the new for next code. This typo was responsible for the issue that JackJames had with the Tone code. Under somewhat rare circumstances this typo caused a variable used with for next not to be cast correctly . This problem did not show up under testing before release of the code. It has been fixed now in the latest build.
The latest build is: 0.98.07 2021-07-24 : Build 1008
https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/Patches
This should be considered a "Critical Update" and as a minimum going forward. Yes, updating may cause some time and inconvenience. However, without this update the generated ASM is likely to be incorrect and certain programs or libraries may not operate as expected.
If you care to see an example of the original for next issue try this code:
The for next will loop endlessly.
Remove the #define and it will execute correctly
Edited link to point to the patch to update to Build 1008
Last edit: William Roth 2021-07-28
You explain the problem well @William Roth.
Never heard off #Define uselegacyfornext
It's the sort of thing the user would have seen.. ie an overflow.
The fact that gcb didn't do something else when compiling like a check is an obvious oversight but can see now how it got this far without being noticed.
My reference to tone was who uses it?
There's some dma stuff on the forum which looks interesting but probably hard to understand pic stuff.
I got to get into pics more but find it easier to use avr cos they come on boards with lots of pins and the usb which you only get with pic dev boards which cost more.
I hope that avr support.. like the lgt328 is kept up as it's great for a lot of stuff and is now sorted and consistent .
Don't get me wrong. I think the pic stuff is brill.. but sometimes over my head.
The idea of a pic with an op amp built in seems a good idea but in practice I bet it's not trivial to set up. So I'd go for a discrete op amp and a bit of extra circuitry.
Still think gcb is really good software.
So the for next problem is the step... which is sorted.
so for count1=0 to 255 step 3 would work but
for count1=0 to 255 step 6 wouldn't.
edit is that what the problem was and did it apply to word value counters as well?
I wouldn't understand how it was resolved but did it test if the step value /255 or /65535 was an exact number ie no remainder? Just a thought.
Last edit: stan cartwright 2021-07-26
@Stan.
The problem was for all variable types. The problem is described with the solution here, see https://sourceforge.net/p/gcbasic/discussion/596084/thread/59d24215/#b174 (same post as Bill Roth shared)
The solution was not as simple as shown on the post above but is gave me insight to resolve.
The original code was simple and covered most cases. But, as the URL above discusses the loops are unacceptable. There is a trade off. The legacy code is smaller ( in this example ) using90+ words of program memory to do all the additional checking.
More example code. If you try this on an UNO you will see the issue.. just uncomment
#DEFINE USELEGACYFORNEXT
to see the continuous loop.This for next error wouldn't have become apparent without sloppy. deliberate programming.
When you think about it it's obvious it could happen... just one of those things that never happens.
Well it never happened to me.. luck?
Posted by Stan
This is simply not true. And, likely based upon how you personally presume a program should be constructed . A perfectly well constructed program could fail under the right conditions. I provided one example.
A For Next has a start value an end value and a step value. Many times we use constants for these since we know where to start, where to end and what the step value should be. But this is not always the case. If these are variables that could change then the compiler needs to be able to handle these in a proper manner without generating final code that is unpredictable.
I can think of several cases where the original for next could fail without "sloppy programming". Perhaps you should educate yourself a bit more before making such off-hand comments.
Perhaps reading this thread might help you.
https://sourceforge.net/p/gcbasic/discussion/596084/thread/59d24215/#b174
William
I seem to have scuppered a previously working program.
I have a For - Next loop which has a negative step value. The value is passed as a parameter into the subroutine. I'm getting an error which states:
Ignoring the Table error for a second, should I be creating the step variable as a separate byte variable within the subroutine and then setting that variable to the value of my parameter or should I be able to use the byte value parameter directly as I was doing previously?
The variable
Reduce
needs to an integer as the error states.'Reduce As Integer' is needed with the FOR-NEXT routines.
If someone can figure out how NOT to have an integer then I would be grateful for the help. But, as you are using a variable the type must be an integer.
Hmm. I think I've missed the point somewhere.
Are you saying that my 'Byte' parameter should be changed to an 'Integer' parameter?
I've never used an integer in GCB. Bytes, Words, Longs yes. Integers? No!
Re-writing the parameter so that it reads:
Isn't the answer.
Nor is:
Please use this as a workaround
I negate the ReduceVar then use that negated value.
There is something not correct in the compiler. It is probably just an errant message but I will have to investigate to resolve. I did ask people to test the FOR_NEXT changes as these changes were extensive - never enough testing :-(
That compiles, thanks for your thoughts.
{Further comments deleted as, again, they might have come across as snarky. Apologies once more.}
Last edit: mkstevo 2021-07-27
Answering my own confusion here.
{I had some other comments regarding use of constants here. I later removed those comments as it has been suggested that although the program compiled it might not have worked as intended.}
I tried leaving the program as it was, adding the legacy directive:
This resulted in a successful compile.
Last edit: mkstevo 2021-07-27
No! Like I said in this post https://sourceforge.net/p/gcbasic/discussion/596084/thread/a56563e36f/#c0fb/747c/4310/d6f8
Your analysis is incorrect.
Please look at https://sourceforge.net/p/gcbasic/discussion/596084/thread/a56563e36f/#c0fb/747c/4310/d6f8
Deleted.
Although I was trying to help with my replies, I don't think they helped at all.
My efforts in trying to locate the cause of the problem may have been interpreted as criticism. That was not my intention and I apologise.
Last edit: mkstevo 2021-07-27
You analysis is correct. Using constants is not the resolution. It is a theory but analysis show it is another cause.
The issue is the NEGATing of the value '-Reduce'. This is causing the variable Reduce to be treater as a BYTE. This has nothing to do with the new FOR-NEXT code as the negate happens before the FOR-NEXT section of the compile is called.
Proof (I have added debug but this shows this to be the case. This casts '-Reduce' to an integer.
As the negate causes the variable to be a byte the ASM generated contains no step variable decrement step code (just increment step code).
This needs fixing.
The table error is easily fixed, though a little fussy.
The error refers to:
I have a lookup table for the alphabet which maps ascii codes to some values which cross reference a first (alphabetic) table into the numeric values needed to show that character on four seven segment LED displays driven by four 74HC595.
221 is a value which lights the top two vertical segments, to give the effect of a double quote. My table is (or was) correct, the quote symbol is 'Rem'ed out by the preceeding single quote.
I can replace the double quote with the phrase 'Double Quotation mark' so it can soon be repaired, though it is a little odd that a remark should be attempted to be compiled?
We have the same issue in the major tables in the compiler. This is not resolvable as the double is the string delimiter.
Your method to resolve is the way to resolve.
Thanks. Though it had been working without issue previously.
Last edit: mkstevo 2021-07-27