Thanks for your replay Chen Xiao Fan, I have the same script as you posted with my installation of MPLAB 7.01. However SHAREBANK is used to define RAM memory regions for *unbanked* registers. At least that's what says my MPASM manual (DS33014G page 122). Now, from the datasheet (DS30569B page12) I can't see no indication that the 96 GPR between 0x20 and 0x6F in Bank0 are *unbanked*, neither are the 32 GPR between 0xA0 and 0xBF in Bank1 for that matter. That means something is wrong after all, no? Perhaps, you can help me out to figure this dilema? Further more, as I said before. If you take the template for the PIC16F870 and the linker script, both coming with MPLAB you'll see that it doesn't compile. And that is not because of the Interrupt no fitting, discard that already fixed. If I modify the linker script as follows the template compiles without complains: // Sample ICD2 linker command file for 16F870 LIBPATH . CODEPAGE NAME=vectors START=0x0 END=0x32 PROTECTED CODEPAGE NAME=page0 START=0x33 END=0x6FF CODEPAGE NAME=debug START=0x700 END=0x7FF PROTECTED CODEPAGE NAME=.idlocs START=0x2000 END=0x2003 PROTECTED CODEPAGE NAME=.config START=0x2007 END=0x2007 PROTECTED CODEPAGE NAME=eedata START=0x2100 END=0x213F PROTECTED DATABANK NAME=sfr0 START=0x0 END=0x1F PROTECTED DATABANK NAME=sfr1 START=0x80 END=0x9F PROTECTED DATABANK NAME=sfr2 START=0x100 END=0x10F PROTECTED DATABANK NAME=sfr3 START=0x180 END=0x18F PROTECTED DATABANK NAME=gpr0 START=0x20 END=0x6F DATABANK NAME=gpr1 START=0xA0 END=0xB4 DATABANK NAME=dbg1 START=0xB5 END=0xBF PROTECTED SHAREBANK NAME=dbg2 START=0x1B5 END=0x1BF PROTECTED SHAREBANK NAME=gprnobnk0 START=0x120 END=0x16F SHAREBANK NAME=gprnobnk1 START=0x1A0 END=0x1B4 SHAREBANK NAME=dbgspr2 START=0x70 END=0x70 PROTECTED SHAREBANK NAME=gprnobnk2 START=0x71 END=0x7F SHAREBANK NAME=dbgspr2 START=0xF0 END=0xF0 PROTECTED SHAREBANK NAME=gprnobnk2 START=0xF1 END=0xFF SHAREBANK NAME=dbgspr2 START=0x170 END=0x170 PROTECTED SHAREBANK NAME=gprnobnk2 START=0x171 END=0x17F SHAREBANK NAME=dbgspr2 START=0x1F0 END=0x1F0 PROTECTED SHAREBANK NAME=gprnobnk2 START=0x1F1 END=0x1FF SECTION NAME=STARTUP ROM=vectors // Reset and interrupt vectors SECTION NAME=PROG1 ROM=page0 // ROM code space - page0 SECTION NAME=IDLOCS ROM=.idlocs // ID locations SECTION NAME=CONFIG ROM=.config // Configuration bits location SECTION NAME=DEEPROM ROM=eedata // Data EEPROM Thanks for your time VV Chen Xiao Fan wrote: My MPLAB 7.01 installation is as following. There is nothing wrong with it. Maybe you need to check your installation. >From C:\Program Files\Microchip\MPASM Suite\LKR: // Sample linker command file for 16F870 // $Id: 16f870.lkr,v 1.5 2002/11/07 23:16:07 sealep Exp $ LIBPATH . CODEPAGE NAME=vectors START=0x0 END=0x4 PROTECTED CODEPAGE NAME=page0 START=0x5 END=0x7FF CODEPAGE NAME=.idlocs START=0x2000 END=0x2003 PROTECTED CODEPAGE NAME=.config START=0x2007 END=0x2007 PROTECTED CODEPAGE NAME=eedata START=0x2100 END=0x213F PROTECTED DATABANK NAME=sfr0 START=0x0 END=0x1F PROTECTED DATABANK NAME=sfr1 START=0x80 END=0x9F PROTECTED DATABANK NAME=sfr2 START=0x100 END=0x10F PROTECTED DATABANK NAME=sfr3 START=0x180 END=0x18F PROTECTED SHAREBANK NAME=gprnobnk0 START=0x20 END=0x6F SHAREBANK NAME=gprnobnk0 START=0x120 END=0x16F SHAREBANK NAME=gprnobnk1 START=0xA0 END=0xBF SHAREBANK NAME=gprnobnk1 START=0x1A0 END=0x1BF SHAREBANK NAME=gprnobnk2 START=0x70 END=0x7F SHAREBANK NAME=gprnobnk2 START=0xF0 END=0xFF SHAREBANK NAME=gprnobnk2 START=0x170 END=0x17F SHAREBANK NAME=gprnobnk2 START=0x1F0 END=0x1FF SECTION NAME=STARTUP ROM=vectors // Reset and interrupt vectors SECTION NAME=PROG1 ROM=page0 // ROM code space - page0 SECTION NAME=IDLOCS ROM=.idlocs // ID locations SECTION NAME=CONFIG ROM=.config // Configuration bits location SECTION NAME=DEEPROM ROM=eedata // Data EEPROM > -----Original Message----- > From: Vincent Vega [mailto:avalon991@yahoo.com] > Sent: Wednesday, March 09, 2005 4:48 PM > To: piclist@mit.edu > Subject: [PIC] MPLAB Linker script and Datasheet for 16F870 > don't match, > any ideas why? > > > Hello everyone, > According to the linker script that comes with MPLAB > ver7.01(16f870.lkr or 16f870i.lkr) all the > RAMs are unbanked. There's no DATABANK sections in the > script, only SHAREBANK. > According to the datasheet that's not the case, there are two > blocks of general purpose > registers (0x20 to 0x7F and 0xA0 to 0xBF) which are indeed banked. > The included with MPLAB template f870tempo.asm won't even > compile properly with the > supplied script. > Any ideas why is it so, any particular reason? > Best regards > VV -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --------------------------------- Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist