Another idea from my half-bakery: On the 65816, it's attractive to use more than 16 bits for addresses. But three bytes is a handful for a machine which is most efficient operating on 16 bit words. So, a 32 bit cell is natural, and in the case of addresses gives us a free extra byte at the top.
Is there any case for tagged addresses in a Forth? That is, using one bit or more of that extra top byte to distinguish different types of addresses. For example, one could have protection between tasks, or distinctions between user and supervisor. Or the tag in the address could relate to the type of the data at the end of the pointer: an integer, a float, a string, an array. Edit: or perhaps a garbage collector could use one or two bits to help its operation.
I think tagged memory is a bit more of a LISPy idea, but perhaps it can apply in Forth?
(Another idea: make integers 24 bits too, so they too have an extra 8 bits of type data in the MSB. But then it becomes a bit fiddly to do arithmetic, especially signed arithmetic. I think this one is even less baked than half.)
[This idea prompted by Scot's post on Liara Forth.]
|