link: minor tweaks

This commit is contained in:
Virgil Dupras 2020-04-11 18:43:43 -04:00
parent bf447f58c5
commit 9390479d49
1 changed files with 6 additions and 5 deletions

View File

@ -138,15 +138,15 @@
and offset because otherwise, things get too complicated and offset because otherwise, things get too complicated
with the PSP. with the PSP.
This word prints the top copied address, so when comes the The output of this word is 3 numbers: top copied address,
time to concat boot binary with this relinked dict, you top copied CURRENT, and then the beginning of the copied dict
can use H@+4 to printed addr. at the end to indicate that we're finished processing.
) )
( target -- ) ( target -- )
: RLDICT : RLDICT
( First of all, let's get our offset. It's easy, it's ( First of all, let's get our offset. It's easy, it's
target's prev field, which is already an offset, minus target's prev field, which is already an offset, minus
its name length. We expect, in COMPACT, that a target's its name length. We expect, in RLDICT that a target's
prev word is a "hook word", that is, an empty word. ) prev word is a "hook word", that is, an empty word. )
( H@ == target ) ( H@ == target )
DUP H@ ! DUP H@ !
@ -171,6 +171,7 @@
DUP H@ + ( u we ) DUP H@ + ( u we )
DUP .X LF DUP .X LF
SWAP CURRENT @ + ( we wr ) SWAP CURRENT @ + ( we wr )
DUP .X LF
BEGIN ( we wr ) BEGIN ( we wr )
DUP ROT ( wr wr we ) DUP ROT ( wr wr we )
( call RLWORD. we need a sig: ol o wr we ) ( call RLWORD. we need a sig: ol o wr we )
@ -187,7 +188,7 @@
( Are we finished? We're finished if wr-4 <= H@ ) ( Are we finished? We're finished if wr-4 <= H@ )
DUP 4 - H@ <= DUP 4 - H@ <=
UNTIL UNTIL
H@ .X LF H@ 4 + .X LF
; ;
( Relink a regular Forth full interpreter. ) ( Relink a regular Forth full interpreter. )