[OpenBIOS] Found out why replacing '\r' with '\n' works

Segher Boessenkool segher at kernel.crashing.org
Mon Apr 18 03:36:28 CEST 2016


On Sun, Apr 17, 2016 at 08:45:31PM -0400, Programmingkid wrote:
> I implemented another stack that two new words use in place of >r and r> when running code in the bootscript. I see this message with and without the '\r' to '\n' patch:
> 
> >> Dictionary space overflow: dicthead=000c3fe4 dictlimit=00080000
> this image is not for this platform
> 
> This means the implementing another stack did not fix the problem. It appears to make it worse. 
> 
> Here is the patch:

Oh my.

hex
20 cells CREATE stash  VARIABLE #stash  #stash off
: stash-push  stash #stash cells + !  1 stash +! ;
: stash-pop   -1 stash +!  stash #stash cells + @ ;
: >r  state @ IF postpone >r EXIT THEN  stash-push ;
: r>  state @ IF postpone r> EXIT THEN  stash-pop ;
: r@  state @ IF postpone r@ EXIT THEN  stash-pop dup stash-push ;

Anyway, I had a quick look at the openbios code and it seems it doesn't
even support IF and similar structure words in interpretation state
at all.  That is a little more work (requires a temporary definition, use
a buffer for that (don't put it at HERE) because you can allocate from
that temp definition; when you reach THEN that temp definition ends (not
just at  ;  ); but things can nest, IF ... IF ... THEN ... THEN.)

It's not too hard but it interacts a little bit with the rest of the Forth
system, so it needs testing etc.  Maybe next weekend.


Segher



More information about the OpenBIOS mailing list