I prefer that my source code documents all of the required PIC register configurations - really just to make the code readable / understandable. I could just add additional comments to include GCBasic's initialisation settings but I'd prefer to override them so that I know that I've not missed a specific register configuration.
I can override / overload InitSys :
sub INITSYS
end sub
The final source code should be readable and complete ... it should provide all that is needed by another developer and fairly independent of compiler. Yes embedded subroutines remain hidden but, as with Basic language itself, the code will remain clear - Wait 2 mS for example is obvious.
Any PIC register configurations must be explained - get these wrong and you end up lost like I was when I migrated from a 12F683 to a 16F18313 and mistakenly expected that the CCP peripheral would, by default, be connected to GP2 / RA2 - felt like trying to open a combination lock !
So I like my documentation to have a register initialisation section that explains exactly all configuration settings.
The subroutine InitSys configures the clock, ADC, comparator and ports and I found that I can just add and overload the existing InitSys by adding the code :
sub INITSYS
end sub
The only remaining piece that I can not override is the inline configuration that immediately follows BASPROGRAMSTART.
The other thing is that some code associated with the configuration becomes redundant - in InitSys TRIS settings are made that I will / might configure to meet my requirement.
Andrew
Last edit: Andrew Jameson 2023-02-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
See the principles for Great Cow BASIC. The ease of use hiding all that complexity.
Get onto the new toolchain and there is a way I can share to take total control. Yes, it has its risks hence it is undocumented.
The latest tool is available on SoucrForge. If you want to stay with the Legacy IDE then I will put you in touch with Angle as he is now ready to release a Legacy IDE with the GCStudio front end (for updates only).. this will take you directly to SynWrite.
Last edit: Anobium 2023-02-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your time - just thoughts and no real problems - just discussion. Yes I fully understand the principles of keeping things simple but there's a purist lurking within me.
I stay with what works too and never moved on from Delphi 5 - all my development and OpenGL games still use it - because it works for me !
Cheers,
Andrew
Many thanks again for producing such a great product with amazingly responsive support !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, here is GCB and ASM. New compiler with no tweaks. It will do as wish - I think.
GCB - I added the #option Bootloader 53 because I have assumed you are doing something in that memory area. I just noticed ORG 58 in your code segment.
I prefer that my source code documents all of the required PIC register configurations - really just to make the code readable / understandable. I could just add additional comments to include GCBasic's initialisation settings but I'd prefer to override them so that I know that I've not missed a specific register configuration.
I can override / overload InitSys :
sub INITSYS
end sub
but this still leaves :
;Start of program memory page 0
ORG 58
BASPROGRAMSTART
;Call initialisation routines
;Enable interrupts
bsf INTCON,GIE
bsf INTCON,PEIE
;Automatic pin direction setting
banksel TRISA
bcf TRISA,5
bcf TRISA,4
bsf TRISA,3
bcf TRISA,0
Anyway that I can override these chunks of code that I don't need ?
(Still using 0.98.06 2019-06-12 (Windows 32 bit))
Thanks,
Andrew
I would need to see you method of overriding (and why).
The final source code should be readable and complete ... it should provide all that is needed by another developer and fairly independent of compiler. Yes embedded subroutines remain hidden but, as with Basic language itself, the code will remain clear - Wait 2 mS for example is obvious.
Any PIC register configurations must be explained - get these wrong and you end up lost like I was when I migrated from a 12F683 to a 16F18313 and mistakenly expected that the CCP peripheral would, by default, be connected to GP2 / RA2 - felt like trying to open a combination lock !
So I like my documentation to have a register initialisation section that explains exactly all configuration settings.
The subroutine InitSys configures the clock, ADC, comparator and ports and I found that I can just add and overload the existing InitSys by adding the code :
sub INITSYS
end sub
The only remaining piece that I can not override is the inline configuration that immediately follows BASPROGRAMSTART.
The other thing is that some code associated with the configuration becomes redundant - in InitSys TRIS settings are made that I will / might configure to meet my requirement.
Andrew
Last edit: Andrew Jameson 2023-02-06
See the principles for Great Cow BASIC. The ease of use hiding all that complexity.
Get onto the new toolchain and there is a way I can share to take total control. Yes, it has its risks hence it is undocumented.
The latest tool is available on SoucrForge. If you want to stay with the Legacy IDE then I will put you in touch with Angle as he is now ready to release a Legacy IDE with the GCStudio front end (for updates only).. this will take you directly to SynWrite.
Last edit: Anobium 2023-02-05
Thanks for your time - just thoughts and no real problems - just discussion. Yes I fully understand the principles of keeping things simple but there's a purist lurking within me.
I stay with what works too and never moved on from Delphi 5 - all my development and OpenGL games still use it - because it works for me !
Cheers,
Andrew
Many thanks again for producing such a great product with amazingly responsive support !
Love the video.
Thank you for your nice words. :-)
When you get onto the new compiler then I will create a video to document the hidden secret.
Andrew... this was bugging me.
So, here is GCB and ASM. New compiler with no tweaks. It will do as wish - I think.
GCB - I added the
#option Bootloader 53
because I have assumed you are doing something in that memory area. I just noticedORG 58
in your code segment.So, I think the upgraade may help you.
Evan
CGB
ASM
Thanks for that - upgrading this week, I think !
Andrew