Hi, Are you using linker or absolute code? Generally it is not a good idea to mix the two, and I think you would better go with linker. Then you can modify the linker script and can define a section as 'protected' for the table and your ordinary code into the first page. Alternatively you can use something like: bigtable code 0x800 Tamas On Mon, Feb 1, 2010 at 7:45 PM, Brendan Gillatt wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > I have a gigantic data table stored in Flash memory on a PIC16F1936:- > greater than 3K words arranged as a series of dt statements. I'm using > the INDFn registers and MOVIW instructions to access the data so it > doesn't really matter where it is placed for it to still work. > > When I link together the various relocatable modules in my code some end > up before and some after the data table. > > The problem is that I have to use PAGESEL to jump to those bits of code > after the table. I know that all of my code will fit in the first page, > and speed is important in this application, so I would rather avoid > PAGESEL altogether and have all the executable code in the first page and > lump the table anywhere on the end. > > For fairly obvious reasons I would rather not specify exactly where every > module resides in memory but still some how force the linker to place the > table afterwards. > > I have tried to specify where to place the table by absolutely > positioning it in memory: > > TABLE_SECTION =A0 CODE =A0 =A00x800 > > BIGTABLE =A0 =A0 =A0 =A0dt =A0 =A0 =A00x00, 0x01, 0x00, 0x02 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dt =A0 =A0 =A00x01, 0x31, 0x00, 0x42 > > etc... > > However this doesn't change the link order--it still puts the same code > modules after the table (just shifted even further up the Flash) > > Am I missing something obvious or is there really no way around this issu= e? > > I'm using "MPASMWIN.exe v5.35, mplink.exe v4.35" with MPLAB v8.43 and the > standard linker file. > > Thank you very much if you can help. > > > - -- > Brendan Gillatt | GPG Key: 0xBF6A0D94 > brendan {a} brendangillatt (dot) co (dot) uk > http://www.brendangillatt.co.uk > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (MingW32) > > iD8DBQFLZy9YHEhZ5Ws5poERAn4SAKC7il/JjFj+mXt9To8g4sZGANoR6wCfTUQD > m9vWgUD0GCtW1IFLK/Z+r94=3D > =3D6YfB > -----END PGP SIGNATURE----- > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = /* www.mcuhobby.com */ int main() { char *a,*s,*q; printf(s=3D"/* www.mcuhobby.com */ int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist