On 03.07.2013 01:19, Duncan Bayne wrote: > Hi Folks, > > I'm hoping to use SDCC to implement a (very!) simple Lisp on an Amstrad > CPC. Now that Maarten has kindly explained the 1kB heap size I can > proceed, but I have a related question: can SDCC make use of switched > RAM offered by the system?
Yes. > Specifically, the Amstrad is capable of switching out 16kB banks of RAM > so that the Z80 - normally limited to a 64kB address space can have up > to, IIRC, around 512kB RAM. Details here: > http://www.norecess.net/advancedmemoryusage.html > > Faced with writing my own memory management code to allocate and free > cons cells, I thought I'd ask whether SDCC is capable of managing > bank-switched memory, so that I can just malloc() away to my heart's > content? No. > If not, and I go ahead and implement something, would this functionality > fit in SDCC? I'm suspicious that it wouldn't, as it's specific to just > one type of Z80 system. > Pointers are just 16 bits wide in the z80 port of sdcc. However, if it is known at compile time, which pointer access goes to which bank, sdcc can handle the bnak switching for you. You need to use named address spaces (more information on named address spaces can be found in the Embedded C standard, and section 3.5.2 in the sdcc manual might also be helpful). Philipp ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user