It would be useful to allow the user to specify the calling convention for z80-related ports on a per-function basis. Not just choosing one known to SDCC (as is possible now using the __sdcccall, __z88dk_fastcall, etc keywords), but actually allow the user to specify which register which parameter is to be passed in. The use-case would be directly interfacing with assembler code that cannot be changed (i.e. BIOSes), to avoid the need for hand-written asm wrapper functions.
For the user interface, C2X attributes would be used, which means we need further work on [feature-requests:#654] first.
This was previously discussed as part of [feature-requests:#253], but IMO it makes more sense to have a separate ticket for it.
Diff:
Related
Feature Requests:
#253Feature Requests: #654
If I understand C2X attribute correctly, for Z80 it should look like something like:
Is that right?
Last edit: Aoineko 2024-10-30
This could improve a lot the efficiency of the z80 code during parameter exchange with existing routines