No. The maximum context you can push into the stack per function call is somewhere near 128 (a bit smaller than that I believe, I forget the 'magic' number here). This is due to C18 uses frame pointer (FSR2) and offset from WREG (PLUSW2) to access the local variables. The offset is a signed value and that means you can access from offset -128 until 127 to the location pointed by FSR. However the local is allocated at higher address side of location pointed by frame pointer and hence you can only push 127 maximum. The actual might be a bit less than that since C18 might reserve some for 'housekeeping' use... As I said I forgot the magic number. The solution if you really need that large data: use static or overlay variable. Best regards, WH Tan > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf > Of Mario Mendes Jr. > Sent: 30 November 2005 10:17 > To: 'Microcontroller discussion list - Public.' > Subject: [PIC] C18 stack too large error > > > Hi guys, > > Once again I come to you for help. > > The following code does not compile and rewards me with the message that > follows it: > > void fnWhatever (void) > { > int i[256]; > } > > Error [1300] stack frame too large > > And this is my modified version of the supplied 18f452.lkr. > > LIBPATH . > > FILES c018i.o > FILES clib.lib > FILES p18f452.lib > > CODEPAGE NAME=vectors START=0x0 END=0x29 > PROTECTED > CODEPAGE NAME=page START=0x2A END=0x7FFF > CODEPAGE NAME=idlocs START=0x200000 END=0x200007 > PROTECTED > CODEPAGE NAME=config START=0x300000 END=0x30000D > PROTECTED > CODEPAGE NAME=devid START=0x3FFFFE END=0x3FFFFF > PROTECTED > CODEPAGE NAME=eedata START=0xF00000 END=0xF000FF > PROTECTED > > ACCESSBANK NAME=accessram START=0x0 END=0x7F > DATABANK NAME=gpr0 START=0x80 END=0xFF > DATABANK NAME=gpr1 START=0x100 END=0x1FF > DATABANK NAME=gpr2 START=0x200 END=0x2FF > DATABANK NAME=gpr3 START=0x300 END=0x3FF > //DATABANK NAME=gpr4 START=0x400 END=0x4FF > //DATABANK NAME=gpr5 START=0x500 END=0x5FF > DATABANK NAME=grp4 START=0x400 END=0x5FF > ACCESSBANK NAME=accesssfr START=0xF80 END=0xFFF > PROTECTED > > SECTION NAME=CONFIG ROM=config > > //STACK SIZE=0x100 RAM=gpr5 > STACK SIZE=0x200 RAM=grp4 > > What exactly am I missing here? > > Thanks in advance. > > > -Mario -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist