include files
Peter Verkaik
Posts: 3,956
I get the following error when I use more than 8 include directives inside an include file.
eg.
main.src file
include "lib.inc"
lib.inc file
include "func1.inc"
include "func2.inc"
include "func3.inc"
include "func4.inc"
include "func5.inc"
include "func6.inc"
include "func7.inc"
include "func8.inc"
;include "func9.inc"
Up to 8 includes works, 9 includes generates the error (and it is not the file that generates the error):
In SASM.dll an error appeared and must be closed. (winxp message)
Hitting don't send generates a SASM message:
SASM was unable to create the .SYM file
File may be open in another application.
I would like to include more than 8 files, using only two include levels.
regards peter
eg.
main.src file
include "lib.inc"
lib.inc file
include "func1.inc"
include "func2.inc"
include "func3.inc"
include "func4.inc"
include "func5.inc"
include "func6.inc"
include "func7.inc"
include "func8.inc"
;include "func9.inc"
Up to 8 includes works, 9 includes generates the error (and it is not the file that generates the error):
In SASM.dll an error appeared and must be closed. (winxp message)
Hitting don't send generates a SASM message:
SASM was unable to create the .SYM file
File may be open in another application.
I would like to include more than 8 files, using only two include levels.
regards peter
Comments
Hmmm...could you concatenate your functions into one file and just have...
include "functALL.inc"
...within your "lib.inc" file? Or concatenate part of your functions into groups/categories?
include "func1_4.inc"
include "func5_9.inc"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
But the number of lines is very large. As each function is self-contained
I really prefer to include them seperately. That is also easier to maintain.
regards peter
mainfile.src
include "lib_main.inc"
lib_main.inc
include "lib_constants.inc"
include "lib_uartCalculations.inc"
include "lib_threads.inc"
include "lib_initPorts.inc"
include "lib_dirbuf.inc"
include "lib_timer8.inc"
include "lib_timer16.inc"
include "lib_queue.inc"
include "lib_stack.inc"
include "lib_parity.inc"
include "lib_uartTransmit.inc"
include "lib_uartReceive.inc"
include "lib_i2cMaster.inc"
include "lib_i2cSlave.inc"
These include files contain no further include directives.
If I insert those include files inline, the mainfile.src assembles correctly.
Using the include directives, I now get an error
Error 67: total number of include files exceeded 31.
However, I only have 15 include files !!
regards peter
Wow, that's not the right response from SASM, is it? Any chance you could send me the project attached to a private message? I have a feeling that the problem is something specific to your project that is making SASM choke, and it'll be way faster for both of us if I can replicate the problem using your code.
Thanks, PeterM
I have zipped all files.
Unzip in a new folder.
The project_template.src is the main file.
It includes lib_total.inc and then it assembles.
Change line 88 to include lib_main.inc and
it chokes on an include statement in lib_main.inc
lib_total.inc is just all functions put together in a single file.
lib_main.inc includes all functions seperately.
regards peter
PS. I could not attach files using private message.
The short answer is this:
The error message is wrong about the number of allowable include files. The actual number is 10, not 31. I need to do some more experimenting to figure out what side effects would occur if I increase the number of include files up to 31. It's not clear to me why there is a discrepancy between the error message and the internal limit, but that's what is happening in SASM right now.
Thanks, PeterM