Just a small observation using a 16F88 and a program that needs a fair amount of space, more than will fit in one page.
When compiled, the compiler leaves a large gap at the page boundary.
For example, the code that goes in the bottom page finishes at 06EE, there is a gap till 0876
where the rest of the code goes.
The program comprises a main block plus several subroutines.
Is there any way to get the Compiler to use more of the available space, ie would using less subroutines help,
or putting all the subroutines first, so the main prog goes in the 2nd page.
Is there any way to tell the compiler where to put the various parts of a prog, memory wise.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GCBASIC always puts the main routine, interrupt handler, and any startup routines into page 0.
It then sorts the remaining subroutines in order of largest to smallest, and allocates them to a page one by one starting with the biggest. Once they've all been placed, it recalculates their size (page selection statements make them grow/shrink), and checks if they still fit. If they don't, then it tries placing them again. It will do this a few times, and if it can't make them fit after about 20 attempts it stops trying and shows an error message.
At the moment there's no way to force it to put certain subroutines into certain banks, but it's something I'll look at doing - it could be quite helpful!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, .
Makes more sense now.
Where does the compiler put string variables.
For example, if the program has a lot of string variable assigments like
variable = "Long String".
Ive noticed that they seem to jump around a bit from either the end of page 0
to the end of page 1 , but havnt figured out exactly what causes it.
Does it make life easier for the compiler if all subroutines are kept very small.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just a small observation using a 16F88 and a program that needs a fair amount of space, more than will fit in one page.
When compiled, the compiler leaves a large gap at the page boundary.
For example, the code that goes in the bottom page finishes at 06EE, there is a gap till 0876
where the rest of the code goes.
The program comprises a main block plus several subroutines.
Is there any way to get the Compiler to use more of the available space, ie would using less subroutines help,
or putting all the subroutines first, so the main prog goes in the 2nd page.
Is there any way to tell the compiler where to put the various parts of a prog, memory wise.
GCBASIC always puts the main routine, interrupt handler, and any startup routines into page 0.
It then sorts the remaining subroutines in order of largest to smallest, and allocates them to a page one by one starting with the biggest. Once they've all been placed, it recalculates their size (page selection statements make them grow/shrink), and checks if they still fit. If they don't, then it tries placing them again. It will do this a few times, and if it can't make them fit after about 20 attempts it stops trying and shows an error message.
At the moment there's no way to force it to put certain subroutines into certain banks, but it's something I'll look at doing - it could be quite helpful!
OK, .
Makes more sense now.
Where does the compiler put string variables.
For example, if the program has a lot of string variable assigments like
variable = "Long String".
Ive noticed that they seem to jump around a bit from either the end of page 0
to the end of page 1 , but havnt figured out exactly what causes it.
Does it make life easier for the compiler if all subroutines are kept very small.
Thanks