diff --git a/blk/122 b/blk/122 index 72ede88..f816e23 100644 --- a/blk/122 +++ b/blk/122 @@ -1 +1 @@ -123 132 LOADR +123 131 LOADR diff --git a/blk/129 b/blk/129 new file mode 100644 index 0000000..8ab643b --- /dev/null +++ b/blk/129 @@ -0,0 +1,16 @@ +( Note that the last word is always skipped because it's not +possible to reliably detect its end. If you need that last +word, define a dummy word before calling RLDICT. + +We first start by copying the affected area to H@+4. This is +where the relinking will take place. + +Then we iterate the new dict from the top, keeping track of +wr, the current wordref and we, wr's end offset. + +Initially, we get our wr and we, withH@ and CURRENT, which we +offset by u+4. +4 before, remember, we're using 4 bytes +as variable space. + +At each iteration, we becomes wr-header and wr is fetched from +PREV field. ) diff --git a/blk/130 b/blk/130 index 8ab643b..8689095 100644 --- a/blk/130 +++ b/blk/130 @@ -1,16 +1,16 @@ -( Note that the last word is always skipped because it's not -possible to reliably detect its end. If you need that last -word, define a dummy word before calling RLDICT. - -We first start by copying the affected area to H@+4. This is -where the relinking will take place. - -Then we iterate the new dict from the top, keeping track of -wr, the current wordref and we, wr's end offset. - -Initially, we get our wr and we, withH@ and CURRENT, which we -offset by u+4. +4 before, remember, we're using 4 bytes -as variable space. - -At each iteration, we becomes wr-header and wr is fetched from -PREV field. ) +: RLDICT ( target offset -- ) + H@ 2+ ! H@ ! ( H@+2 == offset, H@ == target ) + H@ @ WORD( DUP H@ -^ ( src u ) + DUP ROT SWAP H@ 4 + ( u src u dst ) + SWAP MOVE ( u ) + 4 + DUP CURRENT @ WORD( + ( u we ) + DUP .X CRLF + SWAP CURRENT @ PREV + DUP .X CRLF ( we wr ) + BEGIN ( we wr ) + DUP ROT ( wr wr we ) + H@ @ H@ 2+ @ ( wr wr we ol o ) + 2SWAP RLWORD ( wr ) + DUP PREV SWAP ( wr oldwr ) + WORD( SWAP ( we wr ) + DUP 4 - H@ <= ( are we finished? ) + UNTIL H@ 4 + .X CRLF ; diff --git a/blk/131 b/blk/131 index 8689095..2e4efdd 100644 --- a/blk/131 +++ b/blk/131 @@ -1,16 +1,9 @@ -: RLDICT ( target offset -- ) - H@ 2+ ! H@ ! ( H@+2 == offset, H@ == target ) - H@ @ WORD( DUP H@ -^ ( src u ) - DUP ROT SWAP H@ 4 + ( u src u dst ) - SWAP MOVE ( u ) - 4 + DUP CURRENT @ WORD( + ( u we ) - DUP .X CRLF - SWAP CURRENT @ PREV + DUP .X CRLF ( we wr ) - BEGIN ( we wr ) - DUP ROT ( wr wr we ) - H@ @ H@ 2+ @ ( wr wr we ol o ) - 2SWAP RLWORD ( wr ) - DUP PREV SWAP ( wr oldwr ) - WORD( SWAP ( we wr ) - DUP 4 - H@ <= ( are we finished? ) - UNTIL H@ 4 + .X CRLF ; +( Relink a regular Forth full interpreter. ) +: RLCORE + LIT< H@ (find) DROP ( target ) + DUP 3 - @ ( t prevoff ) + ( subtract H@ name length ) + 2- ( t o ) + RLDICT +; + diff --git a/blk/132 b/blk/132 deleted file mode 100644 index 2e4efdd..0000000 --- a/blk/132 +++ /dev/null @@ -1,9 +0,0 @@ -( Relink a regular Forth full interpreter. ) -: RLCORE - LIT< H@ (find) DROP ( target ) - DUP 3 - @ ( t prevoff ) - ( subtract H@ name length ) - 2- ( t o ) - RLDICT -; -