>> Am 19.02.2018 um 10:50 schrieb Maarten Brock:
>> >
>> > Do I understand correctly that your STM8 has code memory
>> above 0xFFFF?
>> > So the problem is that SDCC only generates 16 bit jump/call
>> > instructions and thus cannot reach 0x10000 and above, but
>> it can 'overflow' into that area.
>> >
>> > Does the STM8 have separate 24 bit jump/call instructions?
>> Yes. They are mostly ok, but function calls get awkward.
>> Where it gets really awkward is data above 64K.
>> > Or is it a special mode like on the DS390? Or is one supposed
>> > to use bank switching?
>> > And are there also STM8 versions with only memory below 64k?
>> Only very few STM8 have memory above 64K.
> All STM8 parts with more than 32 kB flash currently cannot be used to
> their full potential with SDCC.
> Looking at the ST website, at the moment this means 58 of the 138
> variants. Including the interesting ones of course. ;-)

That is not a very few. As I understand it now flash and thus code memory
always starts at 0x8000.

> A while ago I did some experiments (sadly not completed yet) by adding a
> 24 bit mode to the SDCC STM8 port. Instead of CALL/RET, CALLF/RETF are
> emitted and the stack calculations need to cope with 3 instead of 2
> bytes for the return. For the constants section I cheated a bit and made
> an option to place this segment before the code segment, so for most (of
> my) programs no further changes would be needed.
>  Eric

That sounds like a sane approach (and not cheating). It is more or less
how I would implement the large memory model as described by Philipp.


Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Sdcc-user mailing list

Reply via email to