I came across a problem where, if you use too much external RAM, it will start to overlap with internal RAM. Just wanted to bring this to everyone’s attention. SDCC does not give any warnings and will just allocate external RAM space past address 0xFF00, which is where internal RAM begins. However, if I use more RAM than the max size, then it will give an error. Here’s a snippet of my “.mem” file.
Other memory:
Name Start End Size Max
---------------- -------- -------- -------- --------
PAGED EXT. RAM 0xf000 0xf0f8 249 256
EXTERNAL RAM 0xf000 0xff5d 3685 3840
ROM/EPROM/FLASH 0x0000 0x44fe 17663 32768
To be fair, I am using an old version of SDCC, version 3.2.0, so this may have been fixed in a newer version.