Comment #2 on issue 112 by robhamerling: Memory allocation for
compiler 'internal' variables
http://code.google.com/p/jallib/issues/detail?id=112
{continuation of previous comment}
Joep and I had a private discussion about the problem and I think below is a
reasonable summary of the analysis. The problem can be solved for all
PICs, but only
partly for the 16F73 and 16F74.
This is how the device files will specify _pic_accum and _pic_isr_w:
1. For all PICs _pic_accum and _pic_isr_w will be declared 'shared' and
allocated in
(the highest location of) shared memory, when available.
2. For PICs with only 1 memory bank there is no distiction between shared
and
unshared memory: no problem.
3. For PICs with multiple banks and both shared and unshared memory
_pic_accum and
_pic_isr_w will be allocated in shared memory. No further special measures
are needed.
4. For PICs with only shared memory _pic_accum and _pic_isr_w will be
declared in
shared memory, the rest of shared memory in (bank 0) will be declared as
unshared
memory. Note this is a compiler requirement: the current compiler allocated
user data
only in unshared memory.
5. For PICs with multiple banks and no shared memory _pic_accum and
_pic_isr_w will
be allocated in the highest location of bank 0 and memory in the other
banks with the
same relative offset (low order 7 address bits) will be reserved (made
unavailable
for user programs).
This is only partly a solution: it will probably work for _pic_isr_w, but
probably
not for _pic_accum for calculations with multi-byte variables which are
allocated in
different banks. But this involves only the 16F73 and 16F74, and because of
this
restriction a warning message will be issued when using the device files of
these PICs.
Note: Currently the device files have most of these items already
implemented, and
these are also documented in 'devicefiles.html', but repeated here to give
a complete
insight in the problem (for possible future reference).
Only some minor changes in some device files are needed.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.