From: slade_rich Date: Wed, 29 Dec 2004 05:53:12 +0000 (+0000) Subject: Adjusted internal stack and pre-allocated registers for device types which have less... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c8ac6b8475e13904ba0ab62c0acb3a1e7ade7b92;p=fw%2Fsdcc Adjusted internal stack and pre-allocated registers for device types which have less than 0x7f registers. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3622 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/pic/device.c b/src/pic/device.c index 3cb56d1f..495eee7d 100644 --- a/src/pic/device.c +++ b/src/pic/device.c @@ -58,7 +58,7 @@ static PIC_device Pics[] = { (memRange *)NULL, (memRange *)NULL, 0, - 0xcf, + 0x4f, /* 68 register available 0x0C to 0x4F (0x8C to 0xCF mapped to bank 0) */ 0x80, }, diff --git a/src/pic/pcode.c b/src/pic/pcode.c index ac42f6c6..2d249b43 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -1347,6 +1347,8 @@ void pCodeInitRegisters(void) stkSize = 8; // Set pseudo stack size to 8 initStack(shareBankAddress, stkSize); // Putting the pseudo stack in shared memory so all modules use the same register when passing fn parameters init_pic(port->processor); + if ((unsigned)shareBankAddress > getMaxRam()) + shareBankAddress = (int)getMaxRam(); pc_status.r = allocProcessorRegister(IDX_STATUS,"STATUS", PO_STATUS, 0x180); pc_pcl.r = allocProcessorRegister(IDX_PCL,"PCL", PO_PCL, 0x80);