tmr4 wrote:
So, is it worth using D as the Forth data stack index just to gain the indirect long mode for the Forth stack? And is it worth it to give up the direct page indexed Y modes?
To me, direct page indexed Y mode doesn't seem important at all. But the first sentence in this quotation poses a valid question. And there are tradeoffs involved, so the "best" answer will vary according to prevailing circumstances and priorities.
I myself am drawn to the idea of using D as the Forth data stack pointer because the '816 has a large address space, and I want my code to be able to adroitly accommodate and manipulate large data sets. For example, a program may collect, search or compare multiple arrays, each of which exceeds 64K. (Being able to exceed 64K of
code is, for me, not a priority.)
I'd say the main tradeoff is between...
- what works best for the Forth words doing the Long accesses, and
- what works best for all the other Forth words.
The latter won't benefit from using D as the Forth data stack pointer; in fact, there are definitely some speed bumps. For example -- as you mentioned -- incrementing the index is more involved.
OTOH, if you
don't use D then the ugly, painful code ends up in the Long access words instead. To reach beyond 64K you'll need gymnastics involving the Data Bank Register. (Hm, or Self Modifying Code, perhaps.)
To summarize, do you want a Forth that's fairly fast overall but bogs down when large data sets are involved? If large data sets are not the main priority then a person can, quite reasonably, choose not to use D as the Forth data stack pointer.
I myself lean in the other direction, because I want an environment that encourages ambitious goals. I don't mind if some Forth words run a little slower if the payoff is being able to achieve maximum efficiency (and elegance) when reaching beyond 64K.
-- Jeff
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html