
Dear Reinhard Meyer,
In message 4CDE30CF.9010509@emk-elektronik.de you wrote:
I *personally* prefer code without tool-chain specific, out of "C" constructs. So I would be fine with passing gd as a parameter to all
I think you would quickly find this becoming a pretty serious pain.
I've been there before. I used this, or tried to use this, before I diged out the technique to reserve a register. This issuch a non-standard mechanism that I hesitated for a long time if doing something like that was acceptable. But otherwise code size will explode: tiny functions, which now are a mere few bytes, wil triple their size and more, because they need to savce registers, load gd from an argument, and pass it as argument to all called functions. You will find you have to add gd as argument basicly to _all_ functions in the code, because these my call another function (which does not use gd), etc. and then, 4 or 5 or evven more levels down there is a single function that needs to access gd.
It is ugly, and a serious pain.
pre-relocation functions. The way they are called with a function array
There are no pure pre-location functions. They gt reused after relocation. And evenbefore relocation you run things like printf() and so on, and it is a nightmare to add gd arguments to all tehs estandard functions.
Been there, and quickly left.
that would probably only marginally increase code size. And instead of
Heh. Try it out, before making such statements.
all the funky stack calculations to get the space for gd, it could be achieved in a much simpler way:
I would be happy if you were right. But you would have to come up with patches that demonstrate that your claims are actually correct to make me change my mind.
Best regards,
Wolfgang Denk