On 28.09.2015 11:13, Maarten Brock wrote: > >> I will try to answer your first question this way: I would like the linker >> could handle the EEPROM as an additional memory space so that addresses >> are calculated by the linker automatically (i.e. by defining an alternate >> descriptor like __eeprom) so that I don't have to maintain an EEPROM >> address table. However, I don't think it would be the job of the compiler >> to generate the code to write to the EEPROM because other chips might >> handle the internal EEPROM differently. Going a step further, if I >> switched to a 2 wire external memory I would only change the EEPROM >> read/write drivers but use the same data definitions. > > Embedded C has defined named address spaces for this purpose. However, I > don't know if this is supported yet by SDCC for the mcs51. If it is > supported (please try it out, see the manual) then it's probably easiest > to place the named address space at a different offset and subtract/mask > that offset in the access functions. > > Maarten
SDCC does not yet have support for this type of named address space (memory read/write through user-defined functions). It currently has support for named address spaces where memory is mapped into the address space, and the mapping is changed via user-defined functions, but reads and writes otherwise work the same as for non-qualified pointers. Philipp
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user