On 07/12/2020 17:23, Philipp Klaus Krause wrote:
That leaves some ports without either:
stm8, pic16, pdk13, pdk14, pdk15.
Hmm, that's unfortunate. :(
This is in relation to the efforts of myself and Georg on substitute
open-source STM8 bootloader erase/write routines.
You see, for these erase and write functions it would be prudent to have
the compiler generate code to preserve registers in a callee-saves
manner, because the STM8 ROM bootloader - having the appearance of
handwritten assembly - does not necessarily use the same calling
convention as SDCC (caller-saves), so we should not rely on it not
needing registers preserved across function calls.
Now, in practice I don't *believe* it'll be an issue, as after studying
some disassemblies of dumps of the bootloader from a variety of STM8
devices, it does not appear their code actually cares if registers are
trashed by the called erase/write functions. But, I think it's better to
be safe than sorry, which is why I was trying to use callee-saves options.
It was only when I tried to apply the option somewhere new to attempt a
small code-size optimisation (as per previous message) that I noticed it
wasn't working.
Any particular reason why callee-saves has not been implemented for STM8?
Regards,
Basil Hussain
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user