
Dear Troy Kisky,
In message 50B659AD.9090704@boundarydevices.com you wrote:
Could you please elucidate why exactly this is _needed_?
My goal was to reduce the number of static variables, but strictly speaking it has little benefit other than giving me a warm fuzzy feeling.
I'm not that only one that dislikes static though.
...
ds is on the stack, and even if not needed now, I like to avoid future random bugs.
Did you check the impact of your changes on the memory footprint?
Changing code that uses a static variable initialized (implicitly or explicitly) to zero [which results in allocation of the BSS segment, i. e. zero space in the code or in the image file] into real code is something that is a bit of expensive just for satisfying random "dislikes".
I think you should better leave that as is. The code is pretty efficent that way, and you increase it for little or no benefit.
Best regards,
Wolfgang Denk