Duncan,

This would require quite some work. AFAIK the Z80 port knows only one kind
of pointer which is limited to 64k. You would have to add some sort of far
pointer to be able to include the bank in its value. Or maybe add a new
memory model instead. The platform specific part can be handled by a
function that switches the bank.

Do you only want to use the banks for data or also for code? That would
require another big step.

The easy way out is to define a struct with the bank and the pointer in it
and create your own allocating and access functions. Make sure to limit
the linker to never use anything in the banked area.

Maarten

>> As far as I know it can't natively manage banked RAM for the Z80 since
>> there is no standard Z80 way of doing it; it is all system specific.
>
> If I were to implement a system-specific malloc for the Amstrad CPC
> series, that was aware of bank-switching and made use of it, would that
> be something of interest to SDCC?
>
> Is there a mechanism for platform-specific (as opposed to CPU-specific)
> features within the codebase ... some sort of contrib mechanism?  Or
> would I be better off implementing this as a standalone library that
> Amstrad developers could link as required?
>
> --
> Duncan Bayne
> ph: +61 420817082 | web: http://duncan-bayne.github.com/ | skype:
> duncan_bayne
>
> I usually check my mail every 24 - 48 hours.  If there's something
> urgent going on, please send me an SMS or call me at the above number.
>
> ------------------------------------------------------------------------------
> 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
>


------------------------------------------------------------------------------
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

Reply via email to