Ttelmah
Joined: 11 Mar 2010 Posts: 19553
|
|
Posted: Mon Sep 04, 2023 4:51 am |
|
|
Yes, provided it is only wanted/used inside HV_INIT.
However do be aware that it is more efficient both in code size and speed
to not have things 'external'.
CCS historically was a single pass compiler, and even on compilers where
this is not the case, stuff that is compiled to an object file, and then linked
to the main, cannot be optimised quite as well as when the whole project
is built as a single entity.
A 'caveat'.
I'm assuming here that be 'external' you mean something that is #EXPORTed
and #IMPORTED into the main project. If the file is just #INCLUDE'd then
this is not 'external', but part of the main project.
As a further comment, it probably will not be stored at all. It'll just be
coded directly into the assembler. It takes just a single instruction to
code a int8 into a value. Just two instructions to code an int16. Storing
it and then retrieving it will involve a lot of code. So the compiler will
just encode it directly into the assembler as needed. |
|