Am 17.07.21 um 00:38 schrieb Alan Cox: > On Fri, 16 Jul 2021 09:49:59 +0200 > Philipp Klaus Krause <p...@spth.de> wrote: > >> For the Z80, many different calling conventions exist. >> Recently, SDCC introduced keywords __raisonance, __cosmic, __iar for the >> stm8 port, that can be used to mark an individual function to use the >> calling convention of the Raisonance, Cosmic or IAR compiler. >> >> For Z80, we already have __smallc, which was introduced to allow calling >> functions originally written in assembler for Small-C. >> >> Would it be useful if z80 and related ports would support more such >> conventions, e.g. for BDS C, Aztex C, IAR, Dynamic C, Hi-Tech, Cross C >> or another C compiler for Z80/Z180/Rabbit? > > Do you plan to also support linking with object modules from those > compilers ? If not I can't see a use case at all. Dynamic C is seriously > warped so it's a pain to port stuff from that to an actual C compiler but > if you cant cross-link it's no use anyway that I can see.
When __smallc was introduced due to user demand, the use case was calling asm code originally written for Small-C from SDCC-generated C code. With recent work on calling conventions, it could be relatively easy to support some further foreign calling conventions, the way we support __smallc. Dynamic C, however would be an exception, as the convention is a bit weird; I guess support would be easier on the callee side than on the caller side (SDCC doesn't have the infrastructure to pass a single argument in two places, as Dynamic C does for the first one, both in registers and on stack). Philipp _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user