[OpenBIOS] Implementing a second return stack

Segher Boessenkool segher at kernel.crashing.org
Sun Apr 17 06:29:31 CEST 2016


On Sat, Apr 16, 2016 at 11:44:11PM -0400, Programmingkid wrote:
> >>> No; just implement a version of >R etc. that work in interpret mode.  Like
> >>> 
> >>> : >r  state @ IF postpone >r EXIT THEN
> >>>     ( and here, do the push to the simulated R stack ) ; IMMEDIATE
> >>> 
> >>> (And easier/cleaner/nicer if your system has separate compile and interpret
> >>> behaviours for all words, or a separate compiler wordlist).
> >> 
> >>> r is implemented in forth.c in c.
> > 
> > The "new" (here defined, in that colon def above) >R calls the "old"
> > version of >R (via "postpone >r").  Don't try to cram everything into
> > the "old" definition, unles you like complexity (and that complexity
> > can be quite enormous, look up what "state smart" words are).
> 
> That code above looks a bit complex. I think implementing another word would be a lot simpler. 

But you want both words to be called >R so how will you do this?  Having
a separate compiler wordlist will solve this (and much bigger problems)
very elegantly, but this is hard to retrofit to an existing design.

Anyway, where do you see complexity?  Verbosity, sure, and doing extra
work (but only in interpretation mode, so you really should not care);
but complexity?


Segher



More information about the OpenBIOS mailing list