The regression test smallc.c fails for the stack-auto variants of mcs51. This is a bug, but probably not a very important one. AFAIK, all or most users of the Small-C calling convention use z80-related backends.
When I search for small-C the only target in common with SDCC I can find is the Z80.
Can I assume that there is no specification for Small-C and more specifically for its calling convention, making the original implementation the standard?
My suggestion is to make __smallc a Z80 specific keyword.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure about the current state of support, but AFAIR, the Small-C-derived compiler developed by z88dk (and which AFAIK is still their default, though they now also support SDCC well) also supports or supported the other z80-related targets SDCC has (except for tlcs90).
Philipp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I search for small-C the only target in common with SDCC I can find is the Z80.
You'll find small C connected with the 8080, 8085, 8088, z80, 6502, 68xx. It had a lot of influence on compilers of that era because it was given away for free.
Can I assume that there is no specification for Small-C and more specifically for its calling convention, making the original implementation the standard?
Yes the original Small-C defined the convention. There might have been influence from Pascal because I can't think of any other reason to go left to right. It doesn't fit well with vararg functions where an additional parameter has to be passed to the function to tell it how many items are on the stack.
the Small-C-derived compiler developed by z88dk also supports or supported the other z80-related targets SDCC has.
sccz80 supports the z80, z180 and r2k.
There are two assembly language libraries in z88dk. One is written for small-C linkage and the new one has separated asm implementation from C interface so that it can use any linkage. For sdcc, the new library uses R->L.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I search for small-C the only target in common with SDCC I can find is the Z80.
Can I assume that there is no specification for Small-C and more specifically for its calling convention, making the original implementation the standard?
My suggestion is to make __smallc a Z80 specific keyword.
I'm not sure about the current state of support, but AFAIR, the Small-C-derived compiler developed by z88dk (and which AFAIK is still their default, though they now also support SDCC well) also supports or supported the other z80-related targets SDCC has (except for tlcs90).
Philipp
I meant to say a Z80-like targets specific keyword. Or in other words, not accepted for ds390/mcs51/hc08/stm8/pic.
You'll find small C connected with the 8080, 8085, 8088, z80, 6502, 68xx. It had a lot of influence on compilers of that era because it was given away for free.
Yes the original Small-C defined the convention. There might have been influence from Pascal because I can't think of any other reason to go left to right. It doesn't fit well with vararg functions where an additional parameter has to be passed to the function to tell it how many items are on the stack.
sccz80 supports the z80, z180 and r2k.
There are two assembly language libraries in z88dk. One is written for small-C linkage and the new one has separated asm implementation from C interface so that it can use any linkage. For sdcc, the new library uses R->L.
In [r9904] I've made __smallc a stm8 and z80-related only keyword.