> So, more banksels can be removed if the compiler will allocate the
> addresses for the variables.

Yes but the linker is there to allocate the space.

It would be sufficient for the compiler to know some blocks
of variables which must be allocated in the same bank, leaving
the linker scope to assign the blocks to banks.

The blocks might equate to the group of globals & static locals
defined in one file, as typically one might define variables along
with the functions which use them the most.

There are other ways you might do this. Assigning variables in a
structure, with a keyword which forces the structure to be allocated
within a single bank, not crossing a bank boundary. I expect the
linker already knows how to allocate other types such as ints and
longs in this way, why not enable larger items to have the property?

The only other way is to alter the sequence of compiler passes
and linking for harvard architecture CPUs. Compile for data, link
the data space, compile for code, and link the code space.

This would help not just PIC. Nearly every 8-bit CPU has to load
the high-byte of an address into a register when accessing a
memory space. It need not reload the high byte for each variable
used that is known to be in the same page. It would save 2 bytes
and the instruction cycles for most variables accessed.


This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein. If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies. It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel.