I understand about the wife. Completely understand.
The changes are very subtle. The one that really made the difference is on line 51 of boot.c, where I put the #pragma udata access fast_vars. That forces the allocation of all variables after that point to be in the 'fast_vars' section (from 0x00 to 0xFF) which means they can be accessed without bank switches. For any oft-used variables, this makes a HUGE difference in size.
<aside> Why the heck can't C18 do this by itself? Is it really that hard to fill the fast_vars section first, then spill over into normal RAM? This really grinds my gears.</aside>
As for your second question, the way to do it is with a modified linker file. These three lines from rm18F2455.lkr show how to do it:
- Code: Select all
CODEPAGE NAME=boot START=0x0 END=0x7FF PROTECTED
CODEPAGE NAME=vectors START=0x800 END=0x829 PROTECTED
CODEPAGE NAME=page START=0x82A END=0x5FFF
Notice that from 0x000 to 0x7FF (the boot sector) is protected,and that the vectors start at 0x800, with normal CODEPAGE space from 0x82A to 0x5FFF.
I hope this explains things well enough-