Sujet : Re: Word name storage quirk in VAX fig-Forth
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 16. Apr 2025, 17:18:56
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Apr16.181856@mips.complang.tuwien.ac.at>
References : 1
User-Agent : xrn 10.11
David Meyer <
papa@sdf.org> writes:
I've been dusting-off fig-Forth for VAX-11 and noticed that every word
in the dictionary has 128 added to the character code of the last
character in the word name.
...
Is there some
peculiarity in fig-Forth or the VAX-11 (I'm using significantly later
hardware and OS) that made this work correctly back in the day?
David Schultz gave the answer to why VLIST works in fig-Forth.
Here's the reason why the last bit is set: Fig-Forth has "variable
length names" as headline feature, whereas earlier Forth systems only
stored the length and 3 characters (i.e., VLIST would output its own
name as VLI__ or so), and would match/conflict with, e.g., VLIKE.
But unlike modern systems, fig-Forth does not always store the full
length of the name. Instead, you could set the length of the number
of characters to be stored by setting a variable. That variable can
change from one definition to the next, so you do not know from this
variable how many characters are stored for a particular name.
Instead, you know the last stored character by looking whether the
most significant bit is set (the most significant bit of the
count+flags byte is also set to allow finding it from the other end.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/EuroForth 2024 proceedings:
http://www.euroforth.org/ef24/papers/