- move assembler from basic compiler to external exe(cutable) program
- move some features from gcbasic to external converter exe(cutable) program
- implement support for external optimizer, same as external converter already implemented
- add keyword for manually adding calltree dependency inside assembler code, not autodetect
- add keyword for asm code , don´t allow automatically detecting asm code. The converter mantains compatibility.
for automatic calltree generation of asm file, it´s a todo if adding this feature to the converter or dropping it for
compatibility with the overall language.
- add asm file , like message file for generating cpu related asm code.
-some changed to include directory, add system.h or gcbas.h that include the asm file inside pic/avr/… directory for system includes.
-add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling
- adds const keyword, that permits generating different code for constant and variable data code.
- adds the possibility to overload code in such a way that the code can be accessed like a variable
- adds two dimensional arrays
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
- memory map like gputils list file
- displaying count (and name in verbose mode) of automatically allocated variables (without dim definition)
If someone have other wishes, that don´t conflicts with mines. or in alternative can be made inside the converter funktion,
then pls. tell me more. Further, if you want such a change, or prefer that this change be a fork of the gcb project, maybe private.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're intending to write code to implement all of these?
I have to admit I don't understand half the things on you're wish list! Could you give a bit more explanation about these lines -
- move some features from gcbasic to external converter exe(cutable) program
- add keyword for manually adding calltree dependency inside assembler code, not autodetect
- add asm file , like message file for generating cpu related asm code.
- some changed to include directory, add system.h or gcbas.h that include the asm file inside pic/avr/… directory for system includes.
- add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling
- adds const keyword, that permits generating different code for constant and variable data code.
- adds the possibility to overload code in such a way that the code can be accessed like a variable
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is already a keyword for assembly instructions - asm. However, the only time it's used at present is for the AVR "sub" instruction, which would otherwise mark the start of a subroutine. Making the use of asm (or a similar keyword) compulsory would mean you'd need to change quite a bit of code in system.h, and would break compatibility with some people's existing programs.
By this:
"adds the possibility to overload code in such a way that the code can be accessed like a variable "
Do you mean like a Property in VB.NET? This is something I've thought would be a good idea for a while, but it would take a bit of code to make it work. If you decide to do this, the best place to put it would probably be inside the ProcessArrays subroutine in gcbasic.bas.
Moving some parts of the compiler into other .exe files could work, though I'm not quite sure what the advantages would be. You would need to have everything called from gcbasic.exe to maintain compatibility with GCGB and Prithvi Development Studio.
Support for an external optimiser might be a useful feature for some people, and would be pretty easy to implement. You could already do it by creating a batch file that runs the optimiser and then the programmer, and setting the batch file as the programmer in gcbasic.ini.
Multi-dimensional arrays are another thing that would be a nice feature. I've been reluctant to add them because of the limited memory on a lot of PICs, and because of the multiplication needed to handle more than one dimension - but they would be very useful for some things!
I don't mind anyone making changes to GCBASIC and distributing them, that's why it's open source! If you'd like to host the altered version on a web site of your own that is fine, or I can add you to the GCBASIC project so that you can upload it here. If you add new features without requiring changes to people's programs, then I'd also be very happy to see the new features merged back in to the standard version of GCBASIC.
But please, do be careful when making changes, and try not to make a version of GCBASIC that won't compile many existing GCBASIC programs!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're intending to write code to implement all of these?
yes
I have to admit I don't understand half the things on you're wish list!
Could you give a bit more explanation about these lines -
- move some features from gcbasic to external converter exe(cutable) program
This should simplify the porting and for the user the only difference is a longer compile time.
one example is the automatic assembler inlining. Probably i make a converter for .gcb files
that behave exactly as the actual compiler, On new libs and code, the asm keyword should be used,
but for old or compatible code, i suggest using the gcb file extension. I don´t know, if this will merge on the
main branch for the basic compiler, but that change speeds up porting the compiler.
- add keyword for manually adding calltree dependency inside assembler code, not autodetect
i want remove the ability of detecting the calltree inside user written assembly and adding a keyword that
allow to specify a calling sequence instead. This allow porting the compiler without needing writing a
assembler for the specified cpu.
- add asm file , like message file for generating cpu related asm code.
This should simplfy porting the gcbasic to annother cpu. like message-de.dat message-sp.dat there could be
codegen-pic12.dat codegen-avr.dat codegen-arm.dat
- some changed to include directory, add system.h or gcbas.h that include the asm file inside pic/avr/… directory for system includes.
instead of a lowlevel directory inside include, i want a system.h file including all the relevant file and instead of handling pic12/pic16/pic18/avr/… in a single file, i want having single directory for every architecture having each a single timer.h file
as example. The reason is, that if i want adding a new cpu, or updating a file, i don´t want waste annother.
- add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling - adds const keyword, that permits generating different code for constant and variable data code.
Two seperate things. The first is , that i want having optional a second pass compiler, that does the following,
include file, execute #script commands, compile, optimize assemble
it´s t.b.d. how to name the #done section. Additionally i want a #compile section that is called ad every invocation .
The reason is, that some libs can do certain optimisation if there know how this libs are called and what part is compiled in.
The other thing is, that i want a const, ie sub foo(const bar) should be different as sub foo(in bar). Const in this case mean
constant data, not variables. if only sub foo(const bar) is defined and foo (fsr) is called then a error should be issued.
Only foo(23) is allowed.
- adds the possibility to overload code in such a way that the code can be accessed like a variable
example
function fofo ' called every time variable foo is accessed as rvalue (read from it)
function/sub foo(bar) ' called if the variable foo is accessed as lvalue (written to it)
The principally intend is for port aliasing
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
i believe that automatic variable declaration inside assembly code should be disallowed. The reason is, that the same
register on different chips could be named differently. Writing the wrong name, or mispelled gives unnoticed and difficult to
trace results. The same apply for support library, if a new pic don´t have a register, or maybe the same register is named
differently. In this case, the compiler don´t should allocate the variable, but should issue a error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
- move assembler from basic compiler to external exe(cutable) program
done
- move some features from gcbasic to external converter exe(cutable) program
in progress
- implement support for external optimizer, same as external converter already implemented
done
-add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling
done, #script is allowed inside macros and there is a option to invoke the included file twice before and after compiling.
repeate loop is allowed inside #script section. The define P holds the pass number starting from 0
Variables inside #scripts with name length of less then two are not exported to defines and usable as internal temporary variables. The first repeate counter is "i", the next nested repeate counter is "j" and "k" , "p" hold the pass,
a-h are granted to be free and should be used as temporary variables, o-z are reserved
The nested repeat is allowed to go up to N, - 6 level in total, and if not in use that variables are usable by the user.
- adds const keyword, that permits generating different code for constant and variable data code.
done,
- adds the possibility to overload code in such a way that the code can be accessed like a variable
testing
- adds two dimensional arrays
done partially / testing
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
done
- memory map like gputils list file
done
- displaying count (and name in verbose mode) of automatically allocated variables (without dim definition)
done
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
- move assembler from basic compiler to external exe(cutable) program
- move some features from gcbasic to external converter exe(cutable) program
- implement support for external optimizer, same as external converter already implemented
- add keyword for manually adding calltree dependency inside assembler code, not autodetect
- add keyword for asm code , don´t allow automatically detecting asm code. The converter mantains compatibility.
for automatic calltree generation of asm file, it´s a todo if adding this feature to the converter or dropping it for
compatibility with the overall language.
- add asm file , like message file for generating cpu related asm code.
-some changed to include directory, add system.h or gcbas.h that include the asm file inside pic/avr/… directory for system includes.
-add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling
- adds const keyword, that permits generating different code for constant and variable data code.
- adds the possibility to overload code in such a way that the code can be accessed like a variable
- adds two dimensional arrays
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
- memory map like gputils list file
- displaying count (and name in verbose mode) of automatically allocated variables (without dim definition)
If someone have other wishes, that don´t conflicts with mines. or in alternative can be made inside the converter funktion,
then pls. tell me more. Further, if you want such a change, or prefer that this change be a fork of the gcb project, maybe private.
You're intending to write code to implement all of these?
I have to admit I don't understand half the things on you're wish list! Could you give a bit more explanation about these lines -
- move some features from gcbasic to external converter exe(cutable) program
- add keyword for manually adding calltree dependency inside assembler code, not autodetect
- add asm file , like message file for generating cpu related asm code.
- some changed to include directory, add system.h or gcbas.h that include the asm file inside pic/avr/… directory for system includes.
- add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling
- adds const keyword, that permits generating different code for constant and variable data code.
- adds the possibility to overload code in such a way that the code can be accessed like a variable
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
There is already a keyword for assembly instructions - asm. However, the only time it's used at present is for the AVR "sub" instruction, which would otherwise mark the start of a subroutine. Making the use of asm (or a similar keyword) compulsory would mean you'd need to change quite a bit of code in system.h, and would break compatibility with some people's existing programs.
By this:
"adds the possibility to overload code in such a way that the code can be accessed like a variable "
Do you mean like a Property in VB.NET? This is something I've thought would be a good idea for a while, but it would take a bit of code to make it work. If you decide to do this, the best place to put it would probably be inside the ProcessArrays subroutine in gcbasic.bas.
Moving some parts of the compiler into other .exe files could work, though I'm not quite sure what the advantages would be. You would need to have everything called from gcbasic.exe to maintain compatibility with GCGB and Prithvi Development Studio.
Support for an external optimiser might be a useful feature for some people, and would be pretty easy to implement. You could already do it by creating a batch file that runs the optimiser and then the programmer, and setting the batch file as the programmer in gcbasic.ini.
Multi-dimensional arrays are another thing that would be a nice feature. I've been reluctant to add them because of the limited memory on a lot of PICs, and because of the multiplication needed to handle more than one dimension - but they would be very useful for some things!
I don't mind anyone making changes to GCBASIC and distributing them, that's why it's open source! If you'd like to host the altered version on a web site of your own that is fine, or I can add you to the GCBASIC project so that you can upload it here. If you add new features without requiring changes to people's programs, then I'd also be very happy to see the new features merged back in to the standard version of GCBASIC.
But please, do be careful when making changes, and try not to make a version of GCBASIC that won't compile many existing GCBASIC programs!
You're intending to write code to implement all of these?
yes
I have to admit I don't understand half the things on you're wish list!
Could you give a bit more explanation about these lines -
- move some features from gcbasic to external converter exe(cutable) program
This should simplify the porting and for the user the only difference is a longer compile time.
one example is the automatic assembler inlining. Probably i make a converter for .gcb files
that behave exactly as the actual compiler, On new libs and code, the asm keyword should be used,
but for old or compatible code, i suggest using the gcb file extension. I don´t know, if this will merge on the
main branch for the basic compiler, but that change speeds up porting the compiler.
- add keyword for manually adding calltree dependency inside assembler code, not autodetect
i want remove the ability of detecting the calltree inside user written assembly and adding a keyword that
allow to specify a calling sequence instead. This allow porting the compiler without needing writing a
assembler for the specified cpu.
- add asm file , like message file for generating cpu related asm code.
This should simplfy porting the gcbasic to annother cpu. like message-de.dat message-sp.dat there could be
codegen-pic12.dat codegen-avr.dat codegen-arm.dat
- some changed to include directory, add system.h or gcbas.h that include the asm file inside pic/avr/… directory for system includes.
instead of a lowlevel directory inside include, i want a system.h file including all the relevant file and instead of handling pic12/pic16/pic18/avr/… in a single file, i want having single directory for every architecture having each a single timer.h file
as example. The reason is, that if i want adding a new cpu, or updating a file, i don´t want waste annother.
- add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling - adds const keyword, that permits generating different code for constant and variable data code.
Two seperate things. The first is , that i want having optional a second pass compiler, that does the following,
include file, execute #script commands, compile, optimize assemble
it´s t.b.d. how to name the #done section. Additionally i want a #compile section that is called ad every invocation .
The reason is, that some libs can do certain optimisation if there know how this libs are called and what part is compiled in.
The other thing is, that i want a const, ie sub foo(const bar) should be different as sub foo(in bar). Const in this case mean
constant data, not variables. if only sub foo(const bar) is defined and foo (fsr) is called then a error should be issued.
Only foo(23) is allowed.
- adds the possibility to overload code in such a way that the code can be accessed like a variable
example
function fofo ' called every time variable foo is accessed as rvalue (read from it)
function/sub foo(bar) ' called if the variable foo is accessed as lvalue (written to it)
The principally intend is for port aliasing
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
i believe that automatic variable declaration inside assembly code should be disallowed. The reason is, that the same
register on different chips could be named differently. Writing the wrong name, or mispelled gives unnoticed and difficult to
trace results. The same apply for support library, if a new pic don´t have a register, or maybe the same register is named
differently. In this case, the compiler don´t should allocate the variable, but should issue a error.
- move assembler from basic compiler to external exe(cutable) program
done
- move some features from gcbasic to external converter exe(cutable) program
in progress
- implement support for external optimizer, same as external converter already implemented
done
-add keyword/section for code, that behaves like #script section, only that it´s executed every invoke or after compiling
done, #script is allowed inside macros and there is a option to invoke the included file twice before and after compiling.
repeate loop is allowed inside #script section. The define P holds the pass number starting from 0
Variables inside #scripts with name length of less then two are not exported to defines and usable as internal temporary variables. The first repeate counter is "i", the next nested repeate counter is "j" and "k" , "p" hold the pass,
a-h are granted to be free and should be used as temporary variables, o-z are reserved
The nested repeat is allowed to go up to N, - 6 level in total, and if not in use that variables are usable by the user.
- adds const keyword, that permits generating different code for constant and variable data code.
done,
- adds the possibility to overload code in such a way that the code can be accessed like a variable
testing
- adds two dimensional arrays
done partially / testing
- disable automatic variable declaration inside assembler (type error on assembler defined variable and no warning)
done
- memory map like gputils list file
done
- displaying count (and name in verbose mode) of automatically allocated variables (without dim definition)
done