This could improve a lot the efficiency of the z80 code during parameter exchange with existing routines
Any news about this feature?
It has to be related to the fact that the returned object is not allocated explicitly by f()
your code seems optimal
Placing an "end label" after each function should be easy for the compiler. The problem is to include the constant data used by the function itself in the block. The critical part is when a table/string/constant is used by multiple functions. The optimal solution would be to compute the coverage of each data structure and include it selectively with its functions, removing duplications. Actually, SDCC has already a coverage test, as it issues a warning for unused variables and data structures.
Would it be possible to increase the number of parameters passed by registers?
it works also for non small but consecutive values in this way: LD A,(CaseVariable) SUB N JP Z,LabelCaseN DEC A JP Z,LabelCaseN_1 DEC A JP Z,LabelCaseN_2 DEC A JP Z,LabelCaseN_3 DEC A JP Z,LabelCaseN_4 [...] LabelDefault: naturally if the range allows it, the jumps can be relative saving a byte per branch
Probably up to 5 branches this latter solution is faster than the one using tables Each branch is 15 cycles (msx timing) 5x15 = 75