6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 10, 2024 10:48 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Mar 28, 2016 12:03 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
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.]


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 02, 2016 8:14 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1928
Location: Sacramento, CA, USA
I am by no means a Forth programmer, but I believe that tagged storage is not in line with the basic Forth philosophy. Cells are just anonymous bit-fields until the code gives them context and meaning ...

... well, I suppose that could be true for numerous computer languages, so maybe my knee-jerk response is a bit too short-sighted. For a description of advanced Forth techniques (like meta-compilers, alternate vocabularies et al.), it would be helpful to hear from Forthers with more experience than my naked n00bness could possibly hope to provide.

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 02, 2016 8:56 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
Yes, I think that could well be so.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: