Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-07 Thread Philipp Klaus Krause
Am 07.05.21 um 23:03 schrieb Павел Бельтюков: > Hi, everybody! > > Thank you for your tips! > > Now BuguRTOS supports large memory model > (https://github.com/shkolnick-kun/bugurtos/commit/b71e6352ff427374e72f9abf74cee6b704c2b5fd >

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-07 Thread Павел Бельтюков
Hi, everybody! Thank you for your tips! Now BuguRTOS supports large memory model ( https://github.com/shkolnick-kun/bugurtos/commit/b71e6352ff427374e72f9abf74cee6b704c2b5fd ). Nevertheless I need to test the common kernel code with IAR and Raisonance, so there may be more changes... BTW, Philipp

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-07 Thread Mike Jagdis via Sdcc-user
I think it's gone the other way in POSIX. Casting function pointers to/from void * is required by dlsym and that's part of the XSI extensions which are optional. However dlsym moved from XSI to Base and now conversion between function pointers and void * is required to work correctly. That's all s

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-07 Thread Philipp Klaus Krause
Am 07.05.21 um 11:50 schrieb Павел Бельтюков: > Hi, Philipp > > Using the normal C syntax. > Function pointers are always 24 bits in the large model, while they are > always 16 bits in the medium model. > Thus, you can't just link files compiled using the medium model with > fi

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-07 Thread Павел Бельтюков
Hi, Philipp Using the normal C syntax. > Function pointers are always 24 bits in the large model, while they are > always 16 bits in the medium model. > Thus, you can't just link files compiled using the medium model with > files compiled using the large model. > OK, then how do I cast a function

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-06 Thread Philipp Klaus Krause
Am 06.05.21 um 16:47 schrieb Павел Бельтюков: > Hi, Philipp! > > * Functions usually return by ret (medium model) or retf (large model). > > So, call/jp and callf/jpf are used in medium and large models > respectfully, aren't them? Yes. Though in the large model, for some function calls, ret

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-06 Thread Павел Бельтюков
Hi, Philipp! * Functions usually return by ret (medium model) or retf (large model). > So, call/jp and callf/jpf are used in medium and large models respectfully, aren't them? How do I declare a function pointer (24 bit) in case of large memory model? Best regards, Paul Beltyukov чт, 6 мая 2021

Re: [Sdcc-user] STM8 memory models and calling conventions

2021-05-06 Thread Philipp Klaus Krause
Am 06.05.21 um 11:11 schrieb Павел Бельтюков: > Hi, everybody! > > Although SDCC manual contains some information about stm8 options > it has no information on working register set and procedure calling > convention. > > Can anyone explain: what registers are used and for what purpose? > > What