BillG wrote:
I have always considered that to be an unfortunate design decision, unnecessarily restricting use of the precious zero page.
That's a valid remark, but it's only valid in certain contexts. Circumstances and priorities make a big difference.
Many 6502 fans began their journey using computers with an existing BIOS/OS that claimed most of zero page for itself, leaving only a small portion uncommitted. In that circumstance it does make sense to be miserly about those few precious, remaining bytes.
I'm not sure what tokafondo's circumstances are, but
things change drastically if legacy zero page usage is absent and one has the luxury of starting with a clean sheet of paper. That's because the routines you create for yourself are likely to consume far less of the precious resource... especially if you create a data stack, allowing z-pg variables to disappear when not in use.
(This isn't just idle talk. My 65xx-based workbench computers have
oodles of free z-pg, despite mapping their VIAs there. It's not the right solution for everyone, but in my own particular circumstances it's a tradeoff that justifies very well indeed. It matters little that I'm unable to run resource-hungry code written by others; for me that isn't a priority.)
I'm not advocating that everyone adopt the same approach as mine. On contrary, the point is to match one's approach to one's priorities and circumstances. And that means being ready in some situations to loosen up the purse strings, so to speak, and
spend some of the precious resource.
-- Jeff
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html