All RES that are in the same UDATA block are always alocated as an continous and sequentional block from the same bank. > Apart from loosing the ability to access 2 x 80 byte blocks > of ram as single 160 byte block of data... If you have this need, you should *defenitely* look at the enhanced 16F1xxx series where this is a no-brainer. You can use one single continous memory block of 1 x 160 bytes with no bit fiddling at all. Add to the the new auto inc/dec and W-rellative addressing modes and you have way easier tools to handle your buffer. And note also that you can use UDATA and RES and specify which bank you want by adding the correct section in the UDATA directive. You can also add your own special purpose sections to the LKR file and reference these in your UDATA directives. That way it's easy to move these around without changing any source code (besides of the LKR file). > I think this is why I prefer assembly Relocatable mode *is* assembly... :-) This is all well thought over and I do not see any of your points that are not covered by relocatable mode. > This may be because I am used to the old approach. Yes, that might very well be the main problem here. :-) Jan-Erik. Justin Richards wrote 2012-12-08 13:07: > I think I will go back to manual memory allocation. > > I would ensure, for example that a shadow register for a port register > would be in the same bank. > > The shared GPR's I treat as precious, for inter process > communications, globally accessed. > > But for most they are only temp and only accessed locally so may as > well exist in the same bank where most of the work is being done. > > I think this is why I prefer assembly as it lends it self to total > control and you can easily optimise for what every efficiency you are > trying to maximise . > > Justin > > > > > > On 8 December 2012 19:15, David Meiklejohn wrote: >> Justin Richards wrote: >>> >>> I now find that I must use banksel directives everywhere because I do >>> not know if the compiler has put the GPR I am referencing in the same >>> bank as a special purpose register I am referencing. >>> >>> For example >>> >>> banksel PORTB >>> movfw PORTB >>> banksel shadow >>> movwf shadow >> >> For an often-accessed variable, such as a shadow register, you can place= it >> in a UDATA_SHR section (shared GPRs), instead of UDATA. Then you don't = need >> the banksel before accessing it. >> >> Of course, you can only do that for a limited number of variables, but b= y >> using shared memory for your most commonly accessed variables, you can c= ut >> down on the need for banksel quite significantly. >> >> >> Cheers, >> David Meiklejohn >> www.gooligum.com.au >> >> >> >> -- >> http://www.piclist.com PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .